I have a large drug use database:
> library(data.table) > df <- data.frame("ID" = c(1,1,1,1,2,2,2,3,3), "IndexDate" = c("201