Thursday, January 12, 2012

matrix to vector by row of by col in R

m <- matrix(....) 
as.vector(m)   # by column 
as.vector(t(m)) # by row 

No comments: