Format R code using air
Arguments
- path
Path to the R file to format. If NULL, attempts to use the active document in RStudio (requires
rstudioapipackage).- ...
Additional arguments passed to
system2().
Details
Install air:
Linux: curl -LsSf https://github.com/posit-dev/air/releases/latest/download/air-installer.sh | sh
Windows: powershell -ExecutionPolicy Bypass -c "irm https://github.com/posit-dev/air/releases/latest/download/air-installer.ps1 | iex"
uv: uv tool install air-formatter
brew (MacOS): brew install air
Examples
if (FALSE) { # \dontrun{
air_format(system.file("R_template/zzz_template.R", package = "rpkgkit"))
} # }
