I have a time-series of events:
time <-c("01-01-1970","01-01-1971","01-01-1971","01-01-1972")
event <-c("A","A","B","B")
df <- data.frame(time, event)
time event
1 01-01-1970 A
2 01-01-1971 A
3 01-01-1971 B
4 01-01-1972 B
Now, I would like to put events that happen at the same time in one line. In my example that would be rows 2 and 3. The outcome should look like this:
time event
1 01-01-1970 A
2 01-01-1971 A & B
4 01-01-1972 B
Any ideas how to do this?
Best, Felix