Here is what I tried to run since I figured I would have to first mutate and then filter the bheavior. Then I used group_by to summarize the subsequent events, but I am getting an error after the third line.
df2 <- df %>% mutate(next_event = lead(real_beh))
df3 <- df2 %>% filter(real_beh=="eat _ STOP")
df4 <- df3 %>% group_by(next_event)
summarise(counts=n())
what am I missing?