Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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). 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!

like image 919
alittleboy Avatar asked Jun 17 '13 22:06

alittleboy


People also ask

How do I create a package in R studio?

You can create your package with devtools or RStudio. devtools::create ("folderpath/package") devtools::setup ("existing/path/") devtools::create (“name”), creates name.Rproj, and R/ folder for code, a description file, and a namespace. Open the Rproj file and work in your project.

Where can I find the RStudio IDE cheat sheet?

For a complete overview for Mac and Windows press ‘Alt Shift K’ (windows) or ‘Option Shift K’ (Mac) in RStudio or see the backside of the Rstudio IDE Cheat Sheet. This and the Package Development Cheat Sheet are two of many available on the RStudio Cheat Sheet Page.

How to create a roxygen Rd file in R?

You can insert a Roxygen skeleton in the Code tab in RStudio or press ‘Alt Shift R’ (not sure this works) Rd uses special text formatting. For example: code{}, eqn{}, emph{}, strong{}, itemize{}, enumerate{}, link{}, link[]{}, url{}, href{}{}, email{} Then, to generate the Rd file.


1 Answers

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"))
like image 101
Gavin Simpson Avatar answered Nov 07 '22 03:11

Gavin Simpson