From janko.thyson at ku-eichstaett.de  Thu Nov  4 01:50:08 2010
From: janko.thyson at ku-eichstaett.de (Janko Thyson)
Date: Thu, 4 Nov 2010 01:50:08 +0100
Subject: [Rd] Roxygen: @example tag does not work for me
Message-ID: <003a01cb7bba$3aa841b0$aff8c510$@thyson@ku-eichstaett.de>

Dear list,

 

somehow I can't get the Roxygen tag "@example" to work for me.

 

My "Roxygen-Header" of a script containing, say, a function looks like this:

 

#' My header

#' 

#' My description

#' 

#' @param a Blabla.

#' @param b Blabla.

#' @return \code{TRUE}. 

#' @callGraphPrimitives

#' @references

#' \url{http://www.something.org /}

#' @author Janko Thyson \email{my.email@@something.com}

#' @example tests/foo.R

#' @seealso \code{\link{some.other.function}}

Foo <- function(a, b){cat("Doing nothing useful.")} 

 

I thought that @example would take the R code in "tests/foo.R" (this file
also exists) and append it to the .Rd-file. However, there is no
\examples{...} section in my roxygen-processed .Rd-file after running
roxygenize(). It just seems as if @example is just neglected. Should I put
the file in another directory? 

 

The basic thing I'm trying to do is to have the "unit tests" for my
functions organized in separate scripts and then plug in some of their
content as examples in the .Rd-files (this should be accomplished by using
in-source documentation ? la Roxygen ? thus something like "@example"
pointing to such a script file would be very neat). I'd definitely like to
get around to "manually" specifying examples via the other tag "@examples"
as they will most likely lead to "out-of-sync" situations regarding the unit
test files. Any ideas?

 

Thanks a lot!

Janko

 



[Rd] Roxygen: @example tag does not work for me
Janko Thyson