Re: [R] inheritence in S4

From: <cgenolin_at_u-paris10.fr>
Date: Mon, 24 Mar 2008 19:56:33 +0100

> The code example is incomplete, so I don't really know why one
> version assigned y=3 for you and the other did not; for me, neither
> version did the assignment.

I probably add the return in the mail without imagining il will change things.

My question was more on the use of ... versus the absence of ... You anwer me by correcting my bug. So I can use callNextMethod with or without ... :

setClass("B",representation(y="numeric")) setMethod("initialize","B",

          function(.Object,..., yValue){
              return(callNextMethod(.Object, ..., y=yValue))
          })

new("B",yValue=3)                   #1
try(new("B",yValueee=3))            #2 try(new("B",yValue=3,yValueee=3))   #3

setMethod("initialize","B",
          function(.Object, yValue){
              return(callNextMethod(.Object, y=yValue))
          })
new("B",yValue=3)                    #4
try(new("B",yValueee=3))             #5

try(new("B",yValue=3,yValueee=3)) #6

I undersand that 1 and 4 work. I understand that 2 and 5 do not work since yValue is missing
I understand that 6 does not work since yValueee is not a valid argument But I would expect that 3 will work since it get a value for yValue and yValueee can be one of the ...

It does not...

Christophe



Ce message a ete envoye par IMP, grace a l'Universite Paris 10 Nanterre

R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Mon 24 Mar 2008 - 19:05:56 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 Mon 24 Mar 2008 - 20:30:24 GMT.

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

list of date sections of archive