Re: [Rd] list element names in S4 class extending list

2007-05-23 Thread Martin Morgan
Hi Vince -- Not a solution, but a little understanding and a workaround. With C1, what happens is that the 'names' attribute of ll gets transfered to the 'names' attribute of the S4 instance. setClass(C1, contains=list) [1] C1 setClass(C2, contains=C1) [1] C2 ll - list(a=1, b=2) c1 - new(C1,

[Rd] list element names in S4 class extending list

2007-05-22 Thread Vincent Carey 525-2265
can list names attributes be preserved through S4 class containment? seems to be so but only if the containment relationship is direct ... see below. setClass(c1, contains=list) [1] c1 l1 = list(a=1, b=2) o1 = new(c1, l1) names(o1) # pleasant surprise [1] a b setClass(c2, contains=c1)