I have a matrix measuring 91 x 2 (i.e 91 rows and two columns).
mat1 <- matrix(1:182, 91, 2)
I need to create a vector from the said matrix of one row. I can do that with the following:
mat2 <- matrix(mat1, nrow = 1, byrow = TRUE)
.
However, I would like to have each row in the original matrix to be represented one after another. Currently it's taking all of column 1 then all of column 2 and joining those together sequentially. Whilst I need them to be in one long row, like this: 1,92,2,93,3,94 etc
Meaning the structure ultimately would be 1,182
(i.e. one row with 182 columns).
How can I achieve this?
Thanks.