'create_report_monthly_counts' generates a data frame of monthly case
counts for each disease for a specific year, with months as columns.
Usage
create_report_monthly_counts(data, y, disease_names)
Arguments
- data
Dataframe. Input data with columns: disease, year, month, counts.
- y
Integer. The year to generate the report for.
- disease_names
Character vector. List of diseases to include in the
report.
Value
Dataframe of monthly counts 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(2024, 2024, 2024, 2023),
month = c(1, 2, 1, 4),
counts = c(5, 7, 8, 9)
)
create_report_monthly_counts(data, 2024, disease_names = c("A", "B", "C"))
#> disease Jan Feb
#> 1 A 5 7
#> 2 B 8 0
#> 3 C 0 0