私のデータは次のようになります。
fruit ID
apple 1
mango 1
orange 1
grapes 2
strawberries 3
reshapeを使用してやりたいのは次のとおりです。
ID Fruit
1 apple,mango,orange
2 grapes
3 strawberries
形を変えてみました
rehshape(data=test,direction="long",varying=c(1,2),v.names="v1",timevar="v2",times=c(1,2))->test.long
しかし、それは明らかに間違っています。