tidy_dir | R Documentation |
Look for all R scripts under a directory (using the pattern
"[.][RrSsQq]$"
), then tidy them with tidy_source()
. If
successful, the original scripts will be overwritten with reformatted ones.
Please back up the original directory first if you do not fully understand
the tricks used by tidy_source()
. tidy_file()
formats
scripts specified by file names.
tidy_dir(path = ".", recursive = FALSE, ...) tidy_file(file, ...)
path |
The path to a directory containning R scripts. |
recursive |
Whether to recursively look for R scripts under |
... |
Other arguments to be passed to |
file |
A vector of filenames. |
Invisible NULL
.
Yihui Xie (tidy_dir
) and Ed Lee (tidy_file
)
tidy_source()
library(formatR) path = tempdir() file.copy(system.file("demo", package = "base"), path, recursive = TRUE) tidy_dir(path, recursive = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.