Format R Code with Arity

Provides R bindings to the deterministic, rule-based formatter from 'arity'. Format R source text or individual files using a style based on the tidyverse R style guide.


Arity

R-CMD-check

arity provides R bindings to the formatter behind arity. The package embeds the published arity-formatter Rust crate; it does not invoke the arity command-line interface.

Format source held in memory:

library(arity)

format_text("x<-(1+2)*3^4\n")
## [1] "x <- (1 + 2) * 3^4\n"

Or format one file in place:

changed <- format_file("R/example.R")

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("arity")

0.1.0 by Johan Larsson, 21 days ago


https://github.com/jolars/arity-r, https://arity.cc


Report a bug at https://github.com/jolars/arity-r/issues


Browse source code at https://github.com/cran/arity


Authors: Johan Larsson [aut, cre, cph] (ORCID:


Documentation:   PDF Manual  


MIT + file LICENSE license


Suggests testthat

System requirements: Cargo (Rust's package manager), rustc >= 1.89.0


See at CRAN