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.7
Depends: R (≥ 3.0.2)
Suggests: codetools, shiny, testit, rmarkdown, knitr
Published: 2019-06-11
Author: Yihui Xie ORCID iD [aut, cre], Eugene Ha [ctb], Kohske Takahashi [ctb], Ed Lee [ctb]
Maintainer: Yihui Xie <xie at>
License: GPL-2 | GPL-3 [expanded from: GPL]
NeedsCompilation: no
Materials: README NEWS
In views: ReproducibleResearch
CRAN checks: formatR results


Reference manual: formatR.pdf
Vignettes: An Introduction to formatR
Package source: formatR_1.7.tar.gz
Windows binaries: r-devel:, r-release:, r-oldrel:
macOS binaries: r-release: formatR_1.7.tgz, r-oldrel: formatR_1.7.tgz
Old sources: formatR archive

Reverse dependencies:

Reverse imports: automagic, datacleanr, distreg.vis, explor, ggThemeAssist, jaggR, lambda.r, MBNMAdose, mustashe, pbixr, plethem, rainette, RaSEn, Rd2roxygen, RFormatter, ScriptMapR, snahelper, splashr
Reverse suggests: ASMap, BaMORC, BASS, condTruncMVN, CoreGx, coveffectsplot, cytometree, DegNorm, DeLorean, dfadjust, DirichletReg, distantia, dynamichazard, elevatr, gen3sis, GenVisR, googleAnalyticsR, googleAuthR, GWAS.BAYES, hdf5r, hsrecombi, kitagawa, knitr, lifecontingencies, loon, madness, manifestoR, matrixNormal, Mega2R, memoria, miWQS, MODIStsp, mosaic, motmot, nph, pez, pinbasic, ProjectTemplate, prospectr, psd, pvar, quanteda, rEDM, resemble, RGalaxy, rhierbaps, sadists, scriptexec, ShiftShareSE, shinyMonacoEditor, simstudy, socialmixr, SoupX, tikzDevice, upsetjs, virtualPollen


Please use the canonical form to link to this page.