I have a data frame that is structured as follows
ID Value1 Value2
1 a;d;g;f 12;14;15;9
2 b;c;e 5;18;20
3 h;i;j 6;7;25
So I have an ID and two values, for value 1 one there are multiple options that correspond to value 2. And I want to end up with the following data frame i.e. every option of value 1 with its corresponding value 2
ID Value1 Value2
1 a 12
1 d 14
1 g 15
1 f 9
2 b 5
2 c 18
2 e 2
3 h 6
3 i 7
3 j 25
How can I script R to do this?