[R] R.oo question

From: Omar Lakkis <uofiowa_at_gmail.com>
Date: Sat 27 May 2006 - 07:36:58 EST


This is a simple R.oo question but I, thankfully, hope that someone would explain it to me so I would better understand this work frame. I create this class:

setConstructorS3("MyExample", function(param=0) {   print(paste("called with param=", param))   extend(Object(), "MyExample",
    .param = param
  );
})

>From what is printed out, who made the second call to the class with
the default param?

> MyExample(1)

[1] "called with param= 1"
[1] "called with param= 0"                # <- this is line in question
[1] "MyExample: 0x02831708"

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Sat May 27 07:42:25 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sat 27 May 2006 - 10:10:56 EST.

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