I have some data like so, that I have loaded into R
Data column 1, Data column 2,option1, option2, option 3.
23, 45.6 , ,option2, option3
5, 30.6 ,option1,option2,
2, 5 , ,, option3
3, 40 , ,option2,
I want to expand the data so the the option columns become row entries and the data columns are duplicated for each option so I can then do a pivot table based on the column with the options in it
so, I want to know how to go from the top table of data to the bottom table of data in R
Data column 1, Data column 2,option
23, 45.6 ,option2,
23, 45.6 ,option3
5, 30.6 ,option1
5, 30.6 ,option2
2, 5 ,option3
3, 40 ,option2