This package is a wrapper around Posit’s Air R Formatter.
You can install the development version of rair like so:
pak::pkg_install("markpaulin/rair")rair can be used to format R code:
library(rair)
bad_code <- "x+ 1 *(3 -0 )"
cat(format_code(bad_code))
#> x + 1 * (3 - 0)This project is a thin wrapper around the Air formatter. It is heavily dependent on the rextendr package, and draws from the tomledit package for rust-related inspiration and from styler for designing an R API for styling code.