Skip to content

formatR

1.14Package record

Format R Code Automatically

24packages dependsuggested by 78
1.5Mdownloads / year
77.8%test coverage
13/13flavors OK

Overview

About

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

CRAN checks
13OK
Slowest check: 1.3 min · r-devel-windows-x86_64
Status changes
  • OK13 OK2026-08-05
  • NOTE12 OK, 1 NOTE2026-08-01
  • OK14 OK2026-03-10
Advisories

none known

Documentation

In release 1.14
README· In the repository, left out of the releaseVignettesYes · 1 · dynamicNEWSYes · does not mention 1.14Citation fileNo
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

1.5M
CRAN downloads in the past year
Rank #278 · ~4.1K/day · ~125.1K/mo
Daily download trend is not available in this view yet.
151.5K30 days
418.6K90 days
1.5M1 year
Compare downloads with other packages →
Also on46.9K r2u105 autocran587.5K conda_forge895 c2d4u

Repository

261Stars
50Forks
10Open issues
1Open PRs
14Releases
639Commits
9Commit identities
rr-packagecode-formatter
639 commits · Last activity 2026-01-17 · 0% stars, 30d · Default branch at 1.14.1, ahead of CRAN 1.14 (checked 2026-10-11)
Responsiveness
How these are sampled
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

2025-03-14 · 2562026-07-07 · 261
PracticesBeta

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.

Continuous integration (2)
GitHub ActionsR CMD check workflow

The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel

Governance and community (3)
Issue templatesFunding

Funding links: GitHub Sponsors

The repository owner accepts GitHub Sponsors

Docs source (1)

GitHub Pages site last deployed 2017-02-05

Coverage (1)
Coverage reporting
Show all practicesHide 1 practice
Lint, format, editor (1)
RStudio project
How this is detected·Detection ruleset v3 (2026-09-26)

Dependencies

Declared dependencies
5 external dependencies (excludes base and recommended)

Installing formatR adds no packages beyond those that come with R.

Depends (1)
R >= 3.2.3
Imports (0)
none
LinkingTo (0)
none
Enhances (0)
none

People & History

People (5)
Author, Maintainer since 0.1-0 (2010)
Contributor · added in 1.5
Contributor · added in 1.9
Contributor · added in 1.5
Contributor · added in 1.5
Releases (55)

Pick two releases to compare their code metrics.

  • R
    R 4.6.0 released · 2026-04-24
  • R
    R 4.5.0 released · 2025-04-11
  • R
    R 4.4.0 released · 2024-04-24
  • R
    R 4.3.0 released · 2023-04-21
  • R
    R 4.2.0 released · 2022-04-22
  • R
    R 4.1.0 released · 2021-05-18
  • R
    R 4.0.0 released · 2020-04-24
  • R
    R 3.6.0 released · 2019-04-26
  • R
    R 3.5.0 released · 2018-04-23
  • R
    R 3.4.0 released · 2017-04-21
  • R
    R 3.3.0 released · 2016-05-03
  • R
    R 3.2.0 released · 2015-04-16
  • R
    R 3.1.0 released · 2014-04-10
  • 3.0.3Latest
    record
    2013-10-26 · current release · diff ↗
  • 3.0.2
    record
    2013-08-06 · diff ↗
  • R
    R 3.0.0 released · 2013-04-03
Show 59 earlier eventsHide 59 earlier events

Package metadata

First published
2010-03-22
Total releases
55 / 16 yrs
License
GPL
Minimum R
≥ 3.2.3
Download size
94 KB
Appears in task views

Cite

Cite this package

Run in R for the authors' preferred citation:

citation("formatR")
Xie, Y., Ha, E., Krivitsky, P., Lee, E., & Takahashi, K. (2023). formatR: Format R Code Automatically (Version 1.14) [Computer software]. https://doi.org/10.32614/CRAN.package.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.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for formatR version 1.14 [Data set]. HJJB, LLC. Data release v2026-10-18. https://doi.org/10.5281/zenodo.21843040

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.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy