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!
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.
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.
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.
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"))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With