Suppose I have the following data frame
library(tidyverse)
df <- tibble(event_id = c(1, 1, 2, 3, 3, 3),
person_id = c(1, 2, 3, 1, 4, 5))
event_id person_id
1 1
1 2
2 3
3 1
3 4
3 5
What I would like is to end up with a data frame that looks like this...
event_id person_1 person_2
1 1 2
2 3 3
3 1 4
3 1 5
3 4 5
How can I do this? Preferably using the tidyverse if possible.