Re: [Rd] as(object,"list") as(object,"matrix") differences?

From: Wolski <wolski_at_molgen.mpg.de>
Date: Fri 10 Sep 2004 - 04:26:40 EST

Hi!

Is this behaviour intended? Now no, nie, niente names are possible. Is this intended? Please run the sample code below.

R : Copyright 2004, The R Foundation for Statistical Computing Version 2.0.0 alpha (2004-09-09), ISBN 3-900051-07-0

setClass("listNamed", "list")
setAs("listNamed", "list", function(from) {

   if(strict) class(from) <- "list"
   from
   })

setMethod("show", "listNamed",

          function(object) {
              cat("An object of class ", class(object), "\n", sep="")
              show(as(object, "list"))
          })

                                                                                                                                                                                                                                            
                                        #NAIVE inheritance from list.
                                        #define cass

setClass("Mlist"

,representation(info="character") #uniq names have to be unique?
,contains="listNamed"
)

tmp <- as.list(1:4)
names(tmp) <- letters[1:4]
mylist<-new("Mlist" , tmp , info="numeric" ) mylist

/E

Dipl. bio-chem. Eryk Witold Wolski             @    MPI-Moleculare Genetic   
Ihnestrasse 63-73 14195 Berlin                'v'                            
tel: 0049-30-83875219                        /   \                           
mail: witek96@users.sourceforge.net        ---W-W----                        
http://r4proteomics.sourceforg.net

R-devel@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Fri Sep 10 04:31:55 2004

This archive was generated by hypermail 2.1.8 : Fri 18 Mar 2005 - 09:00:15 EST