[Rd] R CMD check WARNING \usage question

Bryan Hanson hanson at depauw.edu
Fri Jan 6 20:38:55 CET 2012


Jeff, quick question: is this a data set or a function you are documenting?  What you say sounds like it's data, but the Rd file reads more like a function.  Or are you trying to document a data format/object which stores specific data sets?

Let us know, and I'll bet the answer will appear pretty quickly. Bryan

***********
Bryan Hanson
Professor of Chemistry & Biochemistry
DePauw University

On Jan 6, 2012, at 2:11 PM, Jeff Hamann wrote:

> I'm trying to update a package and would like to crush a WARNING message for a clean build. 
> 
> I've been struggling with this question and haven't gotten any traction on the web either.
> 
> I've got a document file (Rd) that contains the following \usage statement:
> 
> \name{sample.data}
> \alias{sample.data}
> 
> \title{CONIFERS forest growth model sample data}
> 
> \description{ A list object of type \code{sample.data} stores all of
> the basic information about a \code{\link{data.frame}} object
> representing a sample of plants.}
> 
> \usage{
> x <- list( plots=data.frame(), plants=data.frame(), age=0, x0=0.0, n.years.projected=0 )
> class(x)  <- "sample.data"
> }
> 
> When I run R CMD check [pkg], I get the following WARNING:
> 
> * checking Rd \usage sections ... WARNING
> Assignments in \usage in documentation object 'sample.data':
>  x <- list(plots, plants, age = 0, x0 = 0, n.years.projected = 0)
>  class(x) <- "sample.data"
> 
> Functions with \usage entries need to have the appropriate \alias
> entries, and all their arguments documented.
> The \usage entries must correspond to syntactically valid R code.
> See the chapter 'Writing R documentation files' in manual 'Writing R
> Extensions'.
> * checking Rd contents ... OK
> 
> I'm not sure if there's a problem with the \alias section or the \usage section or both sections (I'm assuming this is the case).
> 
> I've read the Chapter 2 of R-ext.pdf plenty and just can't seem to see where I'm blowing it.
> 
> Respectfully,
> Jeff.
> 
> 
> Jeff Hamann, PhD
> PO Box 1421
> Corvallis, Oregon 97339-1421
> 541-754-2457
> jeff.hamann[at]forestinformatics[dot]com
> jeff.d.hamann[at]gmail[dot]com
> http://www.forestinformatics.com
> http://en.wikipedia.org/wiki/Forest_informatics
> 
> To ensure that your email is processed, include a subject entry in your email.
> 
> 
> 
> 
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



More information about the R-devel mailing list