I have a data frame:
a=data.frame(matrix(1:30,ncol=5,byrow=1))
is there a way to extract the original vector (1:30) from the data frame as it exists?
I tried unlist(a)
, but it was ordered by columns, and not row.
1 7 13 19 25 2 8 14 20 26...
unlist(a, byrow=TRUE)
does not work. There must be an efficient way to do this that I am missing, any suggestions