Shravan Vasishth’s Slog (Statistics blog) 2010-10-15 06:47:00

October 15, 2010

(This article was first published on Shravan Vasishth's Slog (Statistics blog), and kindly contributed to R-bloggers)

I foolishly tried to convert a matrix M to a vector using vector:


But this is done column wise, so that adjacent row items end up non-adjacent.

The right way to do this seems to be:

unmatrix(M, byrow=TRUE)

To leave a comment for the author, please follow the link and comment on their blog: Shravan Vasishth's Slog (Statistics blog). offers daily e-mail updates about R news and tutorials on topics such as: visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.