Re: [Rd] S4 assignment \alias and \usage

From: Paul Gilbert <pgilbert_at_bank-banque-canada.ca>
Date: Wed, 30 May 2007 11:08:47 -0400

Let me back up a bit, I may be making another mistake. My code has

setGeneric("TSdoc<-",

    def= function(x, value) standardGeneric("TSdoc<-"),     useAsDefault= function (x, value) {attr(x, "TSdoc") <- value ; x })

setGeneric("TSdoc",

    def= function(x) standardGeneric("TSdoc"),     useAsDefault= function(x) attr(x, "TSdoc"))

In the Rd file I can document the generics with

\alias{TSdoc}
\alias{TSdoc<-}

and usage

    TSdoc(x)
    TSdoc(x) <- value

and these seems to work for the extraction method:

\alias{TSdoc,default-method}
and usage
\S4method{TSdoc}{default}(x)

but perhaps it is not correct. My attempts to find an equivalent for the assignment method have not been successful. Perhaps the first questions are whether this is the correct way to document the generic, and whether the extraction method documentation is only working by accident. The error that is being flagged by chechDocFiles is that there is \usage without a corresponding \alias.

Paul

Seth Falcon wrote:
....
> If you have your own generic TSdoc<-, then I think you want:
>
> \alias{TSdoc<-}
> \alias{TSdoc<-,someClass,anotherClass-method}
>
> You may not be allowed to specify usage, but I think the issue only
> arises when setting methods for a generic documented elsewhere.
>
> + seth
>

Martin Maechler wrote:

>>>>>> "PaulG" == Paul Gilbert <pgilbert_at_bank-banque-canada.ca>
>>>>>>     on Wed, 30 May 2007 09:27:14 -0400 writes:
> 
>     PaulG> What is the Rd file alias and usage syntax for an S4 assignment method? 
>     PaulG> I have been trying variations on
> 
> 
>     PaulG> \alias{TSdoc<-,default-method}
> 
> Do you really have a class called "default" ????
> 
> Using "<func>.default" is an S3 concept which in S4 is replaced
> by defining methods for "ANY".
> 
> 
> In Matrix, we have
> 
> \alias{dim<-,Matrix-method}
> 
> and that works fine
> -- though we don't have a \usage{.} there, since this really is in 
> Matrix-class.Rd
> 
> Martin Maechler
> 
>     PaulG> \usage{
>     PaulG> \S4method{TSdoc}{default}(x) <- value
> 
>     PaulG> but so far I have not got it right according to various codoc, etc, checks.
> 
>     PaulG> Paul Gilbert
====================================================================================

La version franšaise suit le texte anglais.


This email may contain privileged and/or confidential inform...{{dropped}}



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Wed 30 May 2007 - 15:36:24 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 30 May 2007 - 17:33:47 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.