Skip to contents

Computes the daily change in the infectious compartment \(\Delta I\) directly via diff() and plots it as a line chart. The peak is highlighted with a point marker.

Usage

plot_incidence(df)

Arguments

df

A data frame returned by ode_solver() or any built-in model function. Must contain columns time and I.

Value

A ggplot object.

Examples

sir = model_sir(
  init   = c(S = 990, I = 10),
  params = c(beta = 0.002, gamma = 0.1),
  times  = seq(0, 50, by = 0.1)
)
plot_incidence(sir)