format_r | R Documentation |
Uses the {styler}
package to automatically format R sources.
format_r(paths)
paths |
Character vector of files and directories to format. |
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.
None. This function is called for side effects.
if (interactive()) { # Format a single file. format_r("app/main.R") # Format all files in a directory. format_r("app/view") }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.