[R] as(obj,"matrix")

From: Wolski <wolski_at_molgen.mpg.de>
Date: Thu 29 Jul 2004 - 00:55:35 EST


Hi!

Here a simple example.

setClass("myclass"
,representation(info="character")
,contains="matrix"

)

rownames(dd)<-c("a","b")
tt<-new("myclass",dd)
#the source of pain.
as(tt,"matrix")<-matrix(1,3,3)
Error: length of dimnames [1] not equal to array extent

Is there a different way to do what I would like to do (I would like to change the @.Data and all its attributes in the object)?  

Eryk.



R-help@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Thu Jul 29 01:05:57 2004

This archive was generated by hypermail 2.1.8 : Fri 18 Mar 2005 - 02:40:29 EST