我需要从以下内容转换 R 中的数据框:
id past present future
id1 A A B
id2 B C
id3 A C
id4 B B A
对此:
id A B C
id1 past, present future
id2 past future
id3 past present
id4 future past, present
我尝试过使用 dcast,但我对 R 很陌生,并且无法获得任何接近我需要的东西。我应该使用别的东西吗?
谢谢!