[R] as(obj,"matrix")

Wolski wolski at molgen.mpg.de
Wed Jul 28 16:55:35 CEST 2004


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.




More information about the R-help mailing list