Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to not run an example using roxygen2?

Tags:

r

roxygen2

I'm writing a geocoding function right now that relies on having a Bing Maps Key. Obviously I'd rather not publish mine, and the examples fail without one.

How do I include an example for users to run manually, but not have it executed during R CMD check?

like image 519
Ari B. Friedman Avatar asked Aug 20 '12 12:08

Ari B. Friedman


People also ask

How do I run roxygen2?

There are three main ways to run roxygen: roxygen2::roxygenise() . devtools::document() . Ctrl + Shift + D , if you're using RStudio.

How create Rd file in R?

Creating Rd FilesUse the File -> New -> R Documentation command in RStudio. This command will allow you to specify the name of an existing function or dataset to use as the basis for the Rd file or alternatively will create a new empty Rd file.


1 Answers

Use \dontrun{}

#'@examples #'\dontrun{ #'geocode("3817 Spruce St, Philadelphia, PA 19104") #'geocode("Philadelphia, PA") #'dat <- data.frame(value=runif(3),address=c("3817 Spruce St, Philadelphia, PA 19104","Philadelphia, PA","Neverneverland")) #'geocode(dat) #'} 
like image 184
GSee Avatar answered Sep 21 '22 00:09

GSee