I have a the following data frame:
>dta
ids names
1 1001 P1
2 1001 P2
3 1002 P1
4 1003 P2
5 1003 P3
6 1003 P4
7 1004 P1
I want to structure the above set in the following format:
ids V1 V2 V3
1 1001 P1 P2
2 1002 P1
3 1003 P2 P3 P4
4 1004 P1
Please suggest the codes to achieve this. Thanks