[R] setMethodReplace.. Help!

wolski wolski at molgen.mpg.de
Thu Jan 29 14:56:42 CET 2004


Hi!

Trying to reproduce some examples from "Programming with Data" page 341.
Can not reproduce it neither on R1.8.1. nor R1.9.0devel?


library(methods)
setClass("track",representation(x="numeric",y="numeric"))

setMethod("["
          ,"track"
          ,function(x,...,drop=T){
            track(x at x[...],y at y[...])
          }
          )

In method for function "[": Expanding the signature to
include omitted arguments in definition: i = "missing",
j = "missing"
Error in .MakeSignature(new("signature"), def, signature) :
        The names in signature for method (x, , ) don't match function's arguments (x, i, j, drop)

The same....
setReplaceMethod("[","track"
                 ,function(x,...,value)
                 {
                  x at y[...]=as(value,"numeric") 
                 }
                 )


Please Help.
Eryk.




More information about the R-help mailing list