I am facing a problem in restructuring my dataset. I have a dataset in the following form:
Key Color
1 blue
2 yellow
3 red, white
4 purple
5 tan, blue, black
However, I need to restructure it to the below form:
Key Color
1 blue
2 yellow
3 red
3 red
4 purple
5 tan
5 blue
5 black
I am new to R programming so unable to understand which function to use. Please help.