I have a data frame that has the columns x
, y
, z
, x2
, y2
, z2
.
What I would like to do is weave the columns together so they look like:
x y z
x2 y2 z2
For example:
x y z x2 y2 z2
1 1 1 2 2 2
2 2 2 3 3 3
3 3 3 4 4 4
I want it to look like this:
x y z
1 1 1
2 2 2
2 2 2
3 3 3
3 3 3
4 4 4
Is there a way to accomplish this with the zip function?