| tidy.dir {formatR} | R Documentation |
This function first looks for all the R scripts under a
directory (using the pattern "[.][RrSsQq]$"), then
uses tidy.source to tidy these scripts. The
original scripts will be overwritten with reformatted
code if reformatting was successful. You may need to back
up the original directory first if you do not fully
understand the tricks tidy.source is using.
tidy.dir(path = ".", recursive = FALSE, ...)
path |
the directory |
recursive |
whether to recursively look for R
scripts under |
... |
other arguments to be passed to
|
NULL
Yihui Xie <http://yihui.name>
library(formatR)
path = tempdir()
file.copy(system.file("demo", package = "base"), path, recursive = TRUE)
tidy.dir(path, recursive = TRUE)