I have multiple data-frames containing an unknown (and variable) number of columns (always a multiple of 2). Headers of the file look like that:
X0, Y0, X1, Y1, X2, Y2 ... Xn, Yn
Each of the paired columns contains the same number of row, but the number of row is different between non-paired column.
Using R, I would like to slit these data-frames in multiple small one that contain only the paired column:
X0, Y0, X1, Y1, X2, Y2,... Xn, Yn
into:
X0, Y0
X1, Y1
X2, Y2
and so on.
I tried to set up loops but without success so far.
Could anyone point me in the right direction / approach to solve this ?
Many thanks.