I have data in the following format
V1 V2 V3 V4
a 1 A xyz
a 3 B xyz
a 2 C xyz
a 1 D xyz
b 4 A abc
b 3 B abc
b 8 C abc
b 5 D abc
and I'd like to end up with a dataframe looking like this:
U1 U2 A B C D
a xyz 1 3 2 1
b abc 4 3 8 5
While I am new to R, I tried playing around with reshape to get to my result but couldn't. Any pointers would be great, thanks.