[R] how convert an array to a matrix?

Sven Garbade garbade at psy.uni-muenchen.de
Thu Apr 13 14:43:13 CEST 2000


Dear R-list,

is it possible to convert a threedimensional array to a matrix? The
array has the form

, , -4

      -4 -3   -2 -1    0  1    2  3    4
-80 1588 NA 1171 NA 1121 NA  852 NA 1580
0   1497 NA 1311 NA  762 NA 1185 NA 1466
80  1960 NA 1257 NA  941 NA 1435 NA 1636

[...]

I need a matrix like

-80 -4 -4 1588
-80 -3 -4 NA
-80 -2 -4 1171
etc.


I´ve tried write.table() with no succes:

Error in as.data.frame.default(x[[i]], optional = TRUE) : 
	can't coerce array into a data.frame

Thanks,

Sven
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list