| find_peak | R Documentation | 
This function can be used to find the peak of an epidemic curve stored as an
incidence object.
find_peak(x, pool = TRUE)
x | 
 An   | 
pool | 
 If   | 
The date of the (first) highest incidence in the data.
Thibaut Jombart thibautjombart@gmail.com, Zhian N. Kamvar zkamvar@gmail.com
estimate_peak() for bootstrap estimates of the peak time
if (require(outbreaks) && require(ggplot2)) { withAutoprint({
  i <- incidence(fluH7N9_china_2013$date_of_onset)
  i
  plot(i)
  ## one simple bootstrap
  x <- bootstrap(i)
  x
  plot(x)
  ## find 95% CI for peak time using bootstrap
  find_peak(i)
  ## show confidence interval
  plot(i) + geom_vline(xintercept = find_peak(i), col = "red", lty = 2)
})}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.