避免检查使用devtools构建R软件包的示例 [英] avoid checking examples for R package building using devtools
问题描述
我正在使用 devtools
来构建我的R软件包,并使用函数 check
来检查软件包(屏幕上显示一长串输出).但是,由于我的软件包中包含示例,并且其中一些示例很耗时,所以我想知道在 devtools
中检查软件包时如何抑制显示示例. check
函数本身似乎没有这种选项.谢谢!
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!
推荐答案
您需要通过命令行参数将 args
参数设置为 R CMD check
.后者有-no-examples
,请尝试
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")
其中 ....
是您用于 check()
的其他参数.
where ....
are the other arguments you were using for check()
.
通过在命令提示符/shell上使用 R CMD check --help
运行 R CMD check
,可以查看所有参数.要将多个传递给 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"))
这篇关于避免检查使用devtools构建R软件包的示例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!