[Roxygen-devel] documenting multiple methods for a generic S4 method

Vinh Nguyen vqnguyen at uci.edu
Wed Oct 6 00:15:07 CEST 2010


Manuel:

When I turn on use.Rd2=TRUE in roxygenize(), I get an error with my S4
class definition:

##' An S4 class that stores inferential values of a fitted model object.
##'
##' An S4 class that inherits from the \code{matrix} class.  Rows
##' correspond to different coefficients and columns consist of point
##' estimates (point.est), confidence intervals (ci.lo and ci.hi),
##' p-values (p.value), and sample size (n).
##'
##' @name inference-class
##' @slot .Data matrix consisting of inferential values
##' @slot sample.size Sample size used in model fit.
##' @slot robust.se Boolean indicator whether robust standard errors were
##' used.
##' @slot two.sided Boolean indicator whether p-values corresond to a
##' two-sided test or one-sided.
##' @slot ci.level Confidence level.
setClass(Class="inference"
         , representation=representation(model="character"
             , sample.size="numeric"
             , robust.se="logical"
             , two.sided="logical"
             , ci.level="numeric")
         , contains=c("matrix"))

Error:
Processing genF-methods: witten to inference/man/genF-methods.Rd
Processing genF,-method: witten to inference/man/genF,-method.Rd
Processing genF,-method: witten to inference/man/genF,-method.Rd
Processing inference-class
-class:Error in repr[[slots[[i]]$name]] :
  attempt to select less than one element

No Rd files are generated due to the error.  Do you see any error in
my documentation?

Also, I'm a little confused when it comes to @name, @rdname, and
@title for S4 methods documentation with roxygen.  Should all three be
specified?  Should they be identical for the generic definition and
for the particular methods with differing signatures?  Some guidance
would be nice.

Thanks!

I think I'm near the point of just going the S3 route as S4 seems so
complicated in regards to documentation.

Vinh


More information about the Roxygen-devel mailing list