Hello, am I using 'setIs' in the correct way in the subsequent (artifical) example?
Do I have to specify explicit 'setAs' for 'list' and 'vector' or should this work automatically, since "getClass("List1")" states an explicit coerce also for these classes. I'm working with R 2.0.0 Patched (2004-10-06) on windows 2000. Thanks for your advice, Matthias # example setClass(Class = "List1", representation(List = "list")) setClass(Class = "List2", contains = "list") setIs(class1 = "List1", class2 = "List2", coerce = function(obj){ new("List2", [EMAIL PROTECTED]) }, replace = function(obj, value){ [EMAIL PROTECTED] <- value }) getClass("List1") # states explicit coerce for 'list' and 'vector' getClass("List2") L1 <- new("List1", List = list("a")) # all TRUE is(L1, "List2") is(L1, "list") is(L1, "vector") as(L1, "List2") # works # both return 'list()' # why not a 'list' with entry "a"? # Is there an additional 'setAs' needed? as(L1, "list") as(L1, "vector") L2 <- as(L1, "List2") as(L2, "list") # works as(L2, "vector") # works ______________________________________________ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html