This function can be used to find the peak of an epidemic curve stored as an incidence2::incidence object.

find_peak(x)

Arguments

x

An incidence2::incidence object.

Value

A tibble containing the date of the (first) highest incidence in the data along with the count. If x is grouped object then the output will have the peak calculated for each grouping.

See also

estimate_peak() for bootstrap estimates of the peak time.

Author

Tim Taylor

Examples

if (requireNamespace("outbreaks", quietly = TRUE)) { # load data and create incidence data(fluH7N9_china_2013, package = "outbreaks") i <- incidence2::incidence(fluH7N9_china_2013, date_index = date_of_onset) find_peak(i) }
#> 10 missing observations were removed.
#> # A tibble: 1 x 2 #> date_index count #> <date> <int> #> 1 2013-04-03 7