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

From: Erik Iverson <iverson_at_biostat.wisc.edu>
Date: Tue, 04 Mar 2008 18:41:38 -0600

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



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Wed 05 Mar 2008 - 00:44:35 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 05 Mar 2008 - 01:30:20 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive