[Rd] Assignment to a slot in an S4 object in a list seems to violate copy rules?

2010-09-30 Thread Niels Richard Hansen
Dear R-developers I came across the following issue, which I find strange: setClass(A, representation(a = numeric)) B - list() myA - new(A, a = 1) B$otherA - myA b$oth...@a - 2 m...@a Assigning a new value to slot 'a' in the _copy_ of myA stored in B$otherA changes the original value of myA --

Re: [Rd] Assignment to a slot in an S4 object in a list seems to violate copy rules?

2010-09-30 Thread peter dalgaard
On Sep 30, 2010, at 16:19 , Niels Richard Hansen wrote: setClass(A, representation(a = numeric)) B - list() myA - new(A, a = 1) B$otherA - myA b$oth...@a - 2 m...@a R version 2.12.0 Under development (unstable) (2010-09-13 r52905) Platform: i386-apple-darwin9.8.0/i386 (32-bit) --- not

Re: [Rd] Assignment to a slot in an S4 object in a list seems to violate copy rules?

2010-09-30 Thread Thomas Lumley
On Thu, Sep 30, 2010 at 8:15 AM, peter dalgaard pda...@gmail.com wrote: On Sep 30, 2010, at 16:19 , Niels Richard Hansen wrote: setClass(A, representation(a = numeric)) B - list() myA - new(A, a = 1) B$otherA - myA b$oth...@a - 2 m...@a R version 2.12.0 Under development (unstable)

Re: [Rd] Assignment to a slot in an S4 object in a list seems to violate copy rules?

2010-09-30 Thread Prof Brian Ripley
On Thu, 30 Sep 2010, Thomas Lumley wrote: On Thu, Sep 30, 2010 at 8:15 AM, peter dalgaard pda...@gmail.com wrote: On Sep 30, 2010, at 16:19 , Niels Richard Hansen wrote: setClass(A, representation(a = numeric)) B - list() myA - new(A, a = 1) B$otherA - myA b$oth...@a - 2 m...@a R version