format_r {rhino} | R Documentation |
Format R
Description
Uses the {styler}
package to automatically format R sources.
Usage
format_r(paths)
Arguments
paths |
Character vector of files and directories to format. |
Details
The code is formatted according to the styler::tidyverse_style
guide with one adjustment:
spacing around math operators is not modified to avoid conflicts with box::use()
statements.
Value
None. This function is called for side effects.
Examples
if (interactive()) {
# Format a single file.
format_r("app/main.R")
# Format all files in a directory.
format_r("app/view")
}
[Package rhino version 1.9.0 Index]