Creates a ggplot2 visualization of SARI rates, with facets by country and colored by age group.
Arguments
- data
A data.table or data.frame containing SARI rates data, typically output from
get_sari_rates. Must contain columns: date, value, age, countryname.- date_breaks
A string specifying the date breaks for the x-axis (e.g., "1 month", "2 weeks")
- date_format
A string specifying the date format for x-axis labels (e.g.,
"%b %Y"for "Jan 2024")
Examples
# \donttest{
data <- get_sari_rates(
date_min = as.Date("2025-01-01"),
date_max = as.Date("2025-06-30"),
countries = "Spain"
)
plot_sari_rates(data, date_breaks = "1 month")
# }