I have the following data:
request user group
1 1 1
4 1 1
7 1 1
5 1 2
8 1 2
1 2 3
4 2 3
7 2 3
9 2 4
I would like to extract the request-sequences and transpose these into columns.
The result should look like this:
user group request1 request2 request3
1 1 1 4 7
1 2 5 8 NA
2 3 1 4 7
2 4 9 NA NA
I tried to do this with ddply (plyr) but did not come to a working solution.
Thanks in advance!