Suppose I have a data frame with eight digit numbers, each corresponding to one
x <- data.frame(y = c(12345678, 87654321))
I want 8 columns such that each column corresponds to one number i.e.
y1 y2 y3 y4 y5 y6 y7 y8
1 2 3 4 5 6 7 8
8 7 6 5 4 3 2 1
(The columns don't have to be named y1 to y8, I'm just naming them that way for illustrative purposes)
Normally in R, I would use separate
, but here there is no clear separator. How can I do this?