Alos Alos - 1 year ago 74
R Question

How to convert a matrix to a 1 dimensional array in R?

I have a large matrix (32X48).
How can I convert the matrix into a single dimensional array in R?

Answer Source

If we're talking about data.frame, then you should ask yourself are the variables of the same type? If that's the case, you can use rapply, or unlist, since data.frames are lists, deep down in their souls...

 rapply(mtcars, c) # completely stupid and pointless, and slower
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download