I need to transform a data frame in R from something like this:
id past present future
id1 A A B
id2 B C
id3 A C
id4 B B A
To this:
id A B C
id1 past, present future
id2 past future
id3 past present
id4 future past, present
I have tried playing around with dcast but I'm pretty new to R and haven't been able to get anything close to what I need. Should I be using something else?
Thanks!