From stvjc at channing.harvard.edu  Mon May 21 19:12:54 2007
From: stvjc at channing.harvard.edu (Vincent Carey 525-2265)
Date: Mon, 21 May 2007 13:12:54 -0400 (EDT)
Subject: [Rd] list element names in S4 class extending list
Message-ID: <Pine.GSO.4.58.0705211308340.15906@capecod.bwh.harvard.edu>

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")
[1] "c2"
> o2 = new("c2", l1)
> names(o2)     # sad
NULL
> sessionInfo()
R version 2.6.0 Under development (unstable) (2007-05-11 r41535)
powerpc-apple-darwin8.9.0

locale:
C

attached base packages:
[1] "stats"     "graphics"  "grDevices" "utils"     "datasets"  "methods"
[7] "base"



[Rd] list element names in S4 class extending list
Vincent Carey 525-2265