View source: R/aggregate_inc.R
aggregate_inc | R Documentation |
Aggregating daily incidence to longer time windows
aggregate_inc(incid, dt = 7L)
incid |
a vector of daily incidence values |
dt |
a positive integer, or vector thereof, indicating the length(s) of
the desired aggregation window(s). If a vector, this will be recycled. For
example, |
a vector of incidence values, aggregated to dt
## Constant aggregation e.g. weekly reporting
data("SARS2003")
incid <- SARS2003$incidence
dt <- 7L
aggregate_inc(incid, dt)
## Non-constant aggregation e.g. reporting 3x week
#' data("SARS2003")
incid <- SARS2003$incidence
dt <- c(2L,2L,3L)
aggregate_inc(incid, dt)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.