formatR: Format R Code Automatically

Provides a function tidy_source() to format R source code. Spaces and indent will be added to the code automatically, and comments will be preserved under certain conditions, so that R code will be more human-readable and tidy. There is also a Shiny app as a user interface in this package (see tidy_app()).

Version: 1.11
Depends: R (≥ 3.2.3)
Suggests: codetools, shiny, testit, rmarkdown, knitr
Published: 2021-06-01
Author: Yihui Xie ORCID iD [aut, cre], Ed Lee [ctb], Eugene Ha [ctb], Kohske Takahashi [ctb], Pavel Krivitsky [ctb]
Maintainer: Yihui Xie <xie at>
License: GPL-2 | GPL-3 [expanded from: GPL]
NeedsCompilation: no
Materials: NEWS
In views: ReproducibleResearch
CRAN checks: formatR results


Reference manual: formatR.pdf
Vignettes: An Introduction to formatR


Package source: formatR_1.11.tar.gz
Windows binaries: r-devel:, r-release:, r-oldrel:
macOS binaries: r-release (arm64): formatR_1.11.tgz, r-release (x86_64): formatR_1.11.tgz, r-oldrel: formatR_1.11.tgz
Old sources: formatR archive

Reverse dependencies:

Reverse imports: automagic, datacleanr, distreg.vis, explor, ggThemeAssist, glmtrans, jaggR, lambda.r, MBNMAdose, multiverse, mustashe, npcs, pbixr, rainette, RaSEn, Rd2roxygen, RFormatter, rscc, schtools, ScriptMapR, shidashi, shinyChakraUI, snahelper, splashr
Reverse suggests: ASMap, asteRisk, autoharp, BASS, condTruncMVN, CoreGx, coveffectsplot, cytometree, dce, DegNorm, DeLorean, dfadjust, DirichletReg, distantia, dynamichazard, elevatr, gen3sis, GenVisR, GlarmaVarSel, googleAnalyticsR, googleAuthR, GWAS.BAYES, hdf5r, hsrecombi, kitagawa, knitr, lifecontingencies, loon, lsasim, madness, manifestoR, matrixNormal, memoria, miWQS, MODIStsp, mosaic, MotifDb, motmot, nph, paxtoolsr, pez, PhenotypeSimulator, pinbasic, plinkQC, ProjectTemplate, prospectr, psd, pvar, quanteda, rEDM, RGalaxy, rhierbaps, sadists, SANTA, scriptexec, ShiftShareSE, shinyMonacoEditor, SignacX, simstudy, slgf, socialmixr, SoupX, summarytools, tikzDevice, trena, upsetjs, virtualPollen


Please use the canonical form to link to this page.