# NOT RUN {
dat <- data.frame(
dates = as.integer(c(0,1,2,2,3,5,7)),
groups = factor(c(1, 2, 3, 3, 3, 3, 1))
)
i <- incidence(dat, date_index = dates, groups = groups)
i
cumulative_i <- cumulate(i)
cumulative_i
# }
Run the code above in your browser using DataLab