aggregate_inc: Aggregating daily incidence to longer time windows

View source: R/aggregate_inc.R

aggregate_incR Documentation

Aggregating daily incidence to longer time windows

Description

Aggregating daily incidence to longer time windows

Usage

aggregate_inc(incid, dt = 7L)

Arguments

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, dt = c(3L, 4L) would correspond to alternating aggregation windows of 3 and 4 days

Value

a vector of incidence values, aggregated to dt

Examples

## 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)


annecori/EpiEstim documentation built on Sept. 7, 2024, 7:34 p.m.