Skip to contents

A convenience function that sets y-axis breaks to integers only, which is appropriate for count data in epidemic curves. This ensures the y-axis never shows decimal values like 2.5 cases.

Usage

scale_y_epicurve(...)

Arguments

...

Additional arguments passed to ggplot2::scale_y_continuous().

Value

A ggplot2 scale layer.

Examples

library(ggplot2)
cases <- simulate_outbreak(n = 20)

ggplot(cases, aes(x = onset_date)) +
  geom_epicurve(fill = "steelblue") +
  scale_y_epicurve() +
  theme_minimal()