简体   繁体   English

避免使用devtools检查R包构建的示例

[英]avoid checking examples for R package building using devtools

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). 我正在使用devtools来构建我的R包,并使用函数check来检查包(在屏幕上有一长串输出)。 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 . 但是,因为我的包中包含示例,并且某些示例非常耗时,所以我想知道在检查devtools的包时如何禁止检查示例。 The check function itself seems to not have such option. check功能本身似乎没有这样的选择。 Thanks! 谢谢!

You need to set the args argument appropriately with command line arguments to R CMD check . 您需要使用R CMD check命令行参数适当地设置args参数。 The latter has --no-examples so try 后者有--no-examples所以尝试

check(...., args = "--no-examples")

where .... are the other arguments you were using for check() . where ....是你用于check()的其他参数。

You can see all the arguments for R CMD check by running it with R CMD check --help at a command prompt/shell. 您可以通过在命令提示符/ shell中使用R CMD check --help运行它来查看R CMD check的所有参数。 To pass more than one to check() you'll need to concatenate them into a character vector, eg: 要传递多个check()你需要将它们连接成一个字符向量,例如:

check(...., args = c("--no-examples", "--no-tests"))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM