From Kurt.Hornik at wu-wien.ac.at  Wed May 21 13:47:13 2008
From: Kurt.Hornik at wu-wien.ac.at (Kurt Hornik)
Date: Wed, 21 May 2008 13:47:13 +0200
Subject: [Rd] \S4method in combination with "[" and "[<-"
In-Reply-To: <4833DC10.2010007@stamats.de>
References: <4833DC10.2010007@stamats.de>
Message-ID: <18484.3009.586224.475522@fangorn.hornik.net>

>>>>> 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



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