[R] Roxygen examples in DONTRUN mode - how?

Mark Heckmann mark.heckmann at gmx.de
Sat Nov 20 17:18:49 CET 2010


I just found out myself:

Just use the commands you would use in the normal .Rd files aftter the @examples tag in roxygen 
(i.e. @examples dontrun{  some r examples }

Here comes a small roxygen docu example with an example that is NOT RUN.

######################################################################
#' some function title
#'
#' some description
#'
#' @param x any R object that has a print function
#' @return NULL only printing
#' @examples \dontrun{
#'    foo("test")
#'    foo(1:10)
#' }
foo <- function(x) print(x)

–––––––––––––––––––––––––––––––––––––––
Mark Heckmann
Blog: www.markheckmann.de
R-Blog: http://ryouready.wordpress.com



More information about the R-help mailing list