问题
I am using devtools
to build my R package, and use the function check
to check the package (with a long list of outputs on screen). However, because my package includes examples, and some of the examples are time-consuming, I am wondering how can I suppress checking examples when checking the package in devtools
. The check
function itself seems to not have such option. Thanks!
回答1:
You need to set the args
argument appropriately with command line arguments to R CMD check
. The latter has --no-examples
so try
check(...., args = "--no-examples")
where ....
are the other arguments you were using for check()
.
You can see all the arguments for R CMD check
by running it with R CMD check --help
at a command prompt/shell. To pass more than one to check()
you'll need to concatenate them into a character vector, e.g.:
check(...., args = c("--no-examples", "--no-tests"))
来源:https://stackoverflow.com/questions/17158049/avoid-checking-examples-for-r-package-building-using-devtools