[Rd] Documenting generic S4 replacement method for package building

Thomas Roth thomas.k.roth at googlemail.com
Wed Jun 9 18:33:59 CEST 2010

Dear List Members,

I'm struggling with the documentation of a generic S4 replacement method.

I've created a S4 method "lows" via 

setGeneric("lows", function(object) standardGeneric("lows"))
setGeneric("lows<-", function(object, value) standardGeneric("lows<-"))
setMethod("lows", "myClass", function(object)
  listOut = vector(mode = "list")
  for(i in names(factors(object)))
    listOut[i] = low(object at factors[[i]])


setReplaceMethod("lows", "myclass", function(object,value)
  for(i in seq(along = object at factors))
    low(object at factors[[i]]) = value[i]


As far as I understand "2.1.3 Documenting S4 classes and methods (Writing

 I need to call 


After that an S4 replacement method is documented in the same way as an S3
one: see the description of \method in Documenting functions.

That's where I get lost. The example gives me

\method{print}{ts}(x, calendar, \dots)

If I do (see below for the whole file)


R CMD check myPackage gives me

Undocumented code objects
... lows lows<-


Objects in \usage without \alias in documentation object "lows-methods": 

which is S3 syntax?

The problem is probably trivial to somebody who has written a documentation
file for an S4 replacement method but I'm stuck and tried many things, none
of them working. Does somebody what needs to be added to the file?

Thank you in advance

Thomas Roth


\title{Methods for Function lows in Package `myPackage'}
Methods for function \code{lows} in Package `myPackage'

\item{\code{signature(object = "facDesign")}}{
%%  ~~describe this method here~~
\keyword{ ~~ other possible keyword(s) ~~ }

More information about the R-devel mailing list