[R] How to make a 2-dim array being "interpreted" as an array rather than as a matrix

Erik Iverson iverson at biostat.wisc.edu
Wed Mar 5 01:41:38 CET 2008


One more note:


>> Is there any way in which I can "force" a2 to being "interpreted" as
>> having class "array" rather than "matrix" so that foo will work on
>> a2???
> 

Maybe try?

a3 <- structure(1:10, dim = c(2,5), class = "array")

Then class(a3) gives "array", and is.matrix and is.array are both still 
TRUE.

Erik



More information about the R-help mailing list