I want to generate a sequence of date based on a group id(similar IDs should have same date). The id variable contains unequal observations and the length of the data set also varies. How could I create a sequence that starts on specific date (say January 1, 2000 onwards) and continues until the end without specifying length?
Sample data follows: df<-structure(list(id = c(1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 4L, 4L, 4L, 4L, 5L, 5L, 5L, 5L), out1 = c(0L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 1L)), .Names = c("id", "out1"), class = "data.frame", row.names = c(NA, -23L)) ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.