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

Closed
ryan - Oct 15, 2015 at 10:20 PM
rizvisa1 Posts 4479 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Oct 16, 2015 at 02:17 PM
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

rizvisa1 Posts 4479 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 768
Oct 16, 2015 at 02:17 PM
if the data is 2 length character, one way would be to use import option and split on length
0