Matrix are indexed by column so I am guessing you may just need to transpose your data and then construct a new matrix from it:
matrix(t(as.matrix(mydata)), nrow = 1)
Or you can convert it to a vector after the transposing depending on what you need:
as.vector(t(as.matrix(mydata)))