So - I have a data.frame that looks like this:
ID SNPIndex A1 A2
ID1 1 A B
ID1 2 B B
ID1 3 A B
ID2 1 A B
ID2 2 B B
ID2 3 A A
ID3 1 B B
....
and I would like for it to look like this:
ID 1_A1 1_A2 2_A1 2_A2 3_A1 3_A2
ID1 A B B B A B
ID2 A B B B A A
ID3 ...
i.e. I would like one row for each ID and two columns for each SNPIndex - each column with one A1/A2 value.
I would really appreciate your help!