c(t(M)) works too. The advantage of unmatrix(), according to the docs, is that it gives the resulting vector appropriate names. (If you look at the code of unmatrix() you'll see that most of it is taken up with constructing names: the actual data manipulation is done via c(x) or c(t(x)) depending on whether byrow is FALSE or TRUE.
2 comments:
Or you could simply do as.vector(t(M))
I think you mean
library(gdata)
c(t(M)) works too.
The advantage of unmatrix(), according to the docs, is that it gives the resulting vector appropriate names. (If you look at the code of unmatrix() you'll see that most of it is taken up with constructing names: the actual data manipulation is done via c(x) or c(t(x)) depending on whether byrow is FALSE or TRUE.
Post a Comment