Recode id in different time spans
I have longitudinal data on the same individuals across different time spans. How do I assign a new id to the same individual when the time is reset. Here is an example dataset: df <- data.frame(time=c(1,2,3,4,2,3,4,5,6,3,4), id=c(1,1,1,1,1,1,1,1,1,1,1)) df time id 1 1 2 1 3 1 4 1 2 1 3 1 4 1 5… Read More Recode id in different time spans