I have the following data frame:
a<-c(2,1,3,6,7)
b<-c(3,1,4,5,8)
c<-c(9,2,5,4,7)
d<- data.frame(a,b,c)
a b c
1 2 3 9
2 1 1 2
3 3 4 5
4 6 5 4
5 7 8 7
And I would like to transpose the five rows with one single column, like this:
2
3
9
1
1
2
3
4
5
6
5
4
7
8
7
Try this:
Transpose data.frame and redefine as matrix with 1 column.
Thanks to @DavidArenburg, we can also do: