I'd like to expand or split a large data frame with multiple columns according to values in the first column:
Here is my input:
a1;a2;a3 X 1
b1;b2 Y 2
c Z 3
d1;d2;d3 ZZ 4
and output:
a1 X 1
a2 X 1
a3 X 1
b1 Y 2
b2 Y 2
c Z 3
d1 ZZ 4
d2 ZZ 4
d3 ZZ 4
So far I came across the following solution - http://www.r-bloggers.com/expand-delimited-columns-in-r/ but I hope someone could suggest a more straightforward approach.
I'd appreciate any help.