R, moving every other value in a column to a second column

Closed
-
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
-
Hello,

I have been tasked with manipulating the data ina a vector of 900 values in a form of a column. Every two values signifies a lenght and weight number. I need to find a R script to move every other value to their seperate column; one column as lenght and one as width. As an end point, I will need two columns; each with 450 values instead of 900. I would appreciate any assistance.

Thank you



1 reply

Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
768
if the data is 2 length character, one way would be to use import option and split on length