I have a file that basically looks like this.
1 A
2 A
2 B
3 A
3 B
3 C
4 A
4 C
...
I would like to have a file like this
1 A
2 A B
3 A B C
4 A C
...
I tried using the reshape tool in R, but it didn't work...
reshape(df, idvar = V1, timevar = V2, direction = "wide")
gave the following error:
In reshapeWide(data, idvar = idvar, timevar = timevar, ... : multiple rows match for V2=A: first taken
In reshapeWide(data, idvar = idvar, timevar = timevar, ... : multiple rows match for V2=B: first taken
In reshapeWide(data, idvar = idvar, timevar = timevar, ... : multiple rows match for V2=C: first taken
A solution in R or linux is highly appreciated. Thank you!