[Rd] \S4method in combination with "[" and "[<-"

Kurt Hornik Kurt.Hornik at wu-wien.ac.at
Wed May 21 13:47:13 CEST 2008


>>>>> Matthias Kohl writes:

> Dear developers,
> We want to use "\S4method" to document new S4-methods for "[" and "[<-". 
> We use this for other functions/methods and it works without any 
> problem, but in case of "[" and "[<-" we didn't manage to bring this to 
> work.

> The problem occurs in the development version of our package "distrSim" 
> which can be found under http://r-forge.r-project.org/R/?group_id=87.

> The warning we obtain is

> Bad \usage lines found in documentation object 'Subsetting-methods':
>   \S4method{[}{SeqDataFrames}(x, i, j, k, drop = FALSE)
>   \S4method{[<-}{SeqDataFrames}(x, i, j, k, value)

> Of course, we tried several different possibilities but with no
> success.

You should be able to do the same you would do for indicating S3 methods
for subsetting.  I.e.,

  \S4method{[}{SeqDataFrames}(x, i, j, k) <- value

If this does not work, it is a bug.  I'll have a look.

-k

> Does someone know a package which shows a use case for this situation? I 
> looked in several packages but could not found any.

> Thanks for your help!
> Matthias

> -- 
> Dr. Matthias Kohl
> www.stamats.de

> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



More information about the R-devel mailing list