Sklyar, Oleg (London)
2009-Mar-13 14:04 UTC
[Rd] Rd \usage clause for an S4 replace method
Given S4 methods [ and [<-, how do I write the Rd-file usage clause for the latter one? What I have now is: \S4method{[}{TimeSeries,TimeDate,missing}(x, i, j, ..., drop) \S4method{[<-}{TimeSeries,TimeDate,missing,ANY}(x, i, j, ..., value) which results in the following output: ## S4 method for signature 'TimeSeries, TimeDate, missing': x[i, j, ..., drop] \S4method{[<-}{TimeSeries,TimeDate,missing,ANY}(x, i, j, ..., value) How should I document the latter? Thanks. Dr Oleg Sklyar Research Technologist AHL / Man Investments Ltd +44 (0)20 7144 3107 osklyar at maninvestments.com ********************************************************************** Please consider the environment before printing this email or its attachments. The contents of this email are for the named addressees ...{{dropped:19}}
That's not how you use it, surely? The obvious to me \usage{ \S4method{[}{TimeSeries,TimeDate,missing}(x, i, j, ..., drop) \S4method{[}{TimeSeries,TimeDate,missing,ANY}(x, i, j, ...) <- value } works. There is an example of a replacement method using \method in 'Writing R Extensions', so expecting \S4method to work in the same way seems reasonable to me (and I didn't write or document any of this). On Fri, 13 Mar 2009, Sklyar, Oleg (London) wrote:> Given S4 methods [ and [<-, how do I write the Rd-file usage clause for > the latter one? > What I have now is: > > \S4method{[}{TimeSeries,TimeDate,missing}(x, i, j, ..., drop) > \S4method{[<-}{TimeSeries,TimeDate,missing,ANY}(x, i, j, ..., value) > > which results in the following output: > > ## S4 method for signature 'TimeSeries, TimeDate, missing': > x[i, j, ..., drop] > \S4method{[<-}{TimeSeries,TimeDate,missing,ANY}(x, i, j, ..., value) > > How should I document the latter? Thanks. > > > Dr Oleg Sklyar > Research Technologist > AHL / Man Investments Ltd > +44 (0)20 7144 3107 > osklyar at maninvestments.com > > ********************************************************************** > Please consider the environment before printing this email or its attachments. > The contents of this email are for the named addressees ...{{dropped:19}} > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel >-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Apparently Analagous Threads
- 'xtfrm' performance (influences 'order' performance) in R devel
- particulars of importing/loading libraries
- suggesting \alias* for Rd files (in particular for S4 method documentation)
- setClassUnion with numeric; extending class union
- Removing named objects using rm(..)