'create_report_monthly_avgs' generates a data frame of average monthly case
counts for each disease across all years in the input data.
Usage
create_report_monthly_avgs(data, disease_names, config)
Arguments
- data
Dataframe. Input data with columns: disease, year, month, counts.
- disease_names
Character vector. List of diseases to include in the
report.
- config
List. Settings to use for report.
Value
Dataframe of monthly averages with one row per disease and one column
per month (Jan through Dec).
Examples
data <- data.frame(
disease = c("A", "A", "B", "B"),
year = c(2023, 2024, 2023, 2024),
month = c(1, 1, 2, 2),
counts = c(10, 20, 15, 25)
)
config <- list(rounding_decimals = 1)
create_report_monthly_avgs(data, c("A", "B", "C"), config)
#> disease Jan Feb
#> 1 A 15 0
#> 2 B 0 20
#> 3 C 0 0