Skip to content
Back to formatted view

Raw Message

Message-ID: <alpine.LFD.2.00.0903131608460.23780@gannet.stats.ox.ac.uk>
Date: 2009-03-13T16:13:38Z
From: Brian Ripley
Subject: Rd \usage clause for an S4 replace method
In-Reply-To: <1A68FCB28DE72F4BA3B967E6506CCE43047DF73D@mildnpexmb01.maninvestments.ad.man.com>

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