Format R Code Automatically
Overview
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()).
Install
Health
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK14 OK2026-03-10
Documentation
- Help pages
- 7
- Examples that run
- 100%7 run in a plain check (3 of them under a condition)
- Exported functions with examples
- 100%
- Documented parameters
- 95%
- Return-value docs
- 57%
- Help pages citing references
- 29%
Downloads
Repository
- PRs merged (all time)
- 81%
- Median days to close, 50 most recently updated closed issues
- 2
- Median days to close, 50 most recently updated closed PRs
- 0
Stars over time
Forks over time
Releases over time
Issues over time
PRs over time
8 development-tooling and community-health practices detected across 5 families in the upstream repository
Checks run against github.com/yihui/formatr on 2026-10-11.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
Funding links: GitHub Sponsors
The repository owner accepts GitHub Sponsors
GitHub Pages site last deployed 2017-02-05
Show all practicesHide 1 practice
Dependencies
Installing formatR adds no packages beyond those that come with R.
Show the 48 most downloaded packagesHide the 48 most downloaded packages
Code & Tests
People & History
Pick two releases to compare their code metrics.
- RR 4.6.0 released · 2026-04-24
- RR 4.5.0 released · 2025-04-11
- RR 4.4.0 released · 2024-04-24
- RR 4.3.0 released · 2023-04-21
- RR 4.2.0 released · 2022-04-22
- RR 4.1.0 released · 2021-05-18
- RR 4.0.0 released · 2020-04-24
- RR 3.6.0 released · 2019-04-26
- RR 3.5.0 released · 2018-04-23
- RR 3.4.0 released · 2017-04-21
- RR 3.3.0 released · 2016-05-03
- RR 3.2.0 released · 2015-04-16
- RR 3.1.0 released · 2014-04-10
- 3.0.3Latest
- 3.0.22013-08-06 · diff ↗
- RR 3.0.0 released · 2013-04-03
Show 59 earlier eventsHide 59 earlier events
- 2.15.32012-12-02 · diff ↗
- 2.15.22012-07-14 · diff ↗
- 2.15.12012-06-22 · diff ↗
- RR 2.15.0 released · 2012-03-30
- 2.14.12011-11-21 · diff ↗
- RR 2.14.0 released · 2011-10-31
- 2.14.02011-10-27 · diff ↗
- 2.13.2
- 2.13.12011-05-20 · diff ↗
- RR 2.13.0 released · 2011-04-13
- 2.13.02011-03-31 · diff ↗
- 2.12.22011-02-22 · diff ↗
- 2.12.1
- RR 2.12.0 released · 2010-10-15
- RR 2.11.0 released · 2010-04-22
- 2.11.02010-04-20 · diff ↗
- 1.142023-01-17 · diff ↗
- 1.132022-12-22 · diff ↗
- 1.12
- 1.112021-06-01 · diff ↗
- 1.102021-05-25 · diff ↗
- 1.92021-04-14 · diff ↗
- 1.82021-03-12 · diff ↗
- 1.72019-06-11 · diff ↗
- 1.62019-03-05 · diff ↗
- 1.5
- 1.4
- 1.32016-03-05 · diff ↗
- 1.2.12015-09-18 · diff ↗
- 1.22015-04-21 · diff ↗
- 1.12015-03-29 · diff ↗
- 1.02014-08-25 · diff ↗ ·
removed 1 export
tidy.guiadded 4 exports
tidy_app, tidy_dir, tidy_eval, tidy_source - 0.102013-10-26 · diff ↗
- 0.92013-08-05 · diff ↗
- 0.8
- 0.72012-12-02 · diff ↗
- 0.62012-07-13 · diff ↗
- 0.52012-06-22 · diff ↗
- 0.42012-04-02 · diff ↗
- 0.3-42011-11-21 · diff ↗
- 0.3-32011-11-19 · diff ↗
- 0.3-22011-10-26 · diff ↗
- 0.3-1
- 0.2-42011-09-29 · diff ↗
- 0.2-32011-08-12 · diff ↗
- 0.2-22011-05-20 · diff ↗
- 0.2-12011-03-31 · diff ↗
- 0.2-0
- 0.1-92011-01-16 · diff ↗
- 0.1-8
- 0.1-7
- 0.1-62011-01-06 · diff ↗
- 0.1-52010-12-03 · diff ↗
- 0.1-42010-04-22 · diff ↗
- 0.1-32010-04-11 · diff ↗
- 0.1-22010-04-03 · diff ↗
- 0.1-12010-03-26 · diff ↗
- 0.1-02010-03-22
- RR 2.10.0 released · 2009-10-26
Package metadata
- First published
- 2010-03-22
- Total releases
- 55 / 16 yrs
- License
- GPL
- Minimum R
- ≥ 3.2.3
- Download size
- 94 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("formatR")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-18, which the citation names so these numbers can be found later. More on citing and the projects behind them.