I was wondering if there is a way to switch a column under an other one using a function. Basically if I have a dataframe as follow:
a <- data.frame("A" = 1:5, "B" = 2:6)
A B
1 1 2
2 2 3
3 3 4
4 4 5
5 5 6
I would like to get something like:
A
1 1
2 2
3 3
4 4
5 5
6 2
7 3
8 4
9 5
10 6