I have a large 2D matrix that is 1000 x 1000. I want to reshape this so that it is one column (or row). For example, if the matrix was:
A B C
1 4 7
2 5 8
3 6 9
I want to turn it in to:
1 2 3 4 5 6 7 8 9
I do not need to preserve the column headers, just the order of the data. How do I do this using reshape2
(which is the package that I presumed was the easiest to use)?
Just to clarify, I mentioned reshape
as I thought it was the best way of doing this. I can see that there are simpler methods which I am perfectly happy with.