Skip to content
Prev 91408 / 398500 Next

document setReplaceMethod

Jennifer> Hi,
    Jennifer> How do I document setReplaceMethod, such as this,

    Jennifer> setGeneric("x<-", function(.Object, value)
    Jennifer>			standardGeneric("myMethod<-"))

the above looks wrong.
I assume you want

 setGeneric("x<-", function(.Object, value) standardGeneric("x<-"))

??

    Jennifer> setReplaceMethod("x", "myClass",
    Jennifer>   function(.Object, value) {
    Jennifer>  .Object at x <- value
    Jennifer>  .Object
    Jennifer> }
    Jennifer> )

    Jennifer> in the NAMESPACE file?

well,  the NAMESPACE is not for documentation, but for importing
and exporting of R symbols (or "objects" if you like).

So I assume you that you want to make

    x(........) <- ........

abvailable, i.e. export it?
I didn't try, but I think 
  
   exportMethods("x<-") # name of the generic, as with other methods

should work.

Regards,
Martin Maechler, ETH Zurich