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.14
Depends: R (≥ 3.2.3)
Suggests: rstudioapi, shiny, testit, rmarkdown, knitr
Published: 2023-01-17
DOI: 10.32614/CRAN.package.formatR
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.14.tar.gz
Windows binaries: r-devel:, r-release:, r-oldrel:
macOS binaries: r-release (arm64): formatR_1.14.tgz, r-oldrel (arm64): formatR_1.14.tgz, r-release (x86_64): formatR_1.14.tgz, r-oldrel (x86_64): formatR_1.14.tgz
Old sources: formatR archive

Reverse dependencies:

Reverse imports: automagic, cohortBuilder, datacleanr, dbGaPCheckup, distreg.vis, explor, funspotr, ggThemeAssist, glmtrans, HKRbook, jaggR, lambda.r, matrans, multiverse, npcs, RaSEn, Rd2roxygen, RFormatter, rscc, schtools, ScriptMapR, shidashi, shinyChakraUI, snahelper
Reverse suggests: ASMap, asteRisk, ausplotsR, autoharp, BeeBDC, BG2, condTruncMVN, conText, CoreGx, coveffectsplot, cytometree, dce, DegNorm, dfadjust, DirichletReg, discourseGT, distantia, elevatr, gen3sis, GenVisR, ggordiplots, GlarmaVarSel, googleAnalyticsR, googleAuthR, GWAS.BAYES, hdf5r, hdm, hsrecombi, iemisc, iemiscdata, iemisctext, kitagawa, knitr, lifecontingencies, loon, lsasim, madness, manifestoR, MarkowitzR, matrixNormal, MBNMAdose, Mega2R, memoria, mfp2, miWQS, mosaic, MotifDb, motmot, multe, MultiGlarmaVarSel, NBtsVarSel, NMdata, nph, nuts, pareg, paxtoolsr, pez, PhenotypeSimulator, plinkQC, ProjectTemplate, prospectr, psd, pvar, quanteda, RDHonest, rEDM, resemble, rexposome, rhierbaps, riskCommunicator, sadists, scriptexec, ShiftShareSE, shinyMonacoEditor, SignacX, simitation, simstudy, sketchy, slgf, SoupX, SticsRFiles, summarytools, teal.reporter, tidySEM, tikzDevice, upsetjs, VedicDateTime, virtualPollen


Please use the canonical form to link to this page.