I have a data frame, with only one column, and I want to turn it into a two column by selecting only certain rows, here…let me show you
I want to go from this
V1
1 one
2 two
3 &&three
4 four
5 &&five
6 six
to this
V1 V2
1 one NA
2 two three
3 four five
4 six NA
So the ones that have a && are placed in column two, to the right of the above row (hope that makes sense). Is there any way I can do this?
Here’s my approach:
Read in the data:
The reshaping:
Which yields: