Re: [R] slot assignment in S4 classes

2010-05-12 Thread Martin Morgan
On 05/12/2010 01:48 AM, Albert-Jan Roskam wrote: > Hi R friends, > > I'm still studying S4 classes and I have a question about slot assignment. Why would I have to use a special setter method [example 2 below] if I can assign data to a slot directly when I call new() [example 1 below]? > > ## f

[R] slot assignment in S4 classes

2010-05-12 Thread Albert-Jan Roskam
Hi R friends,   I'm still studying S4 classes and I have a question about slot assignment. Why would I have to use a special setter method [example 2 below] if I can assign data to a slot directly when I call new() [example 1 below]?   ## first way to do it (the idiosyncratic way?) setClass(Class