format_epitrax_data
prepares the input EpiTrax data for use by report generation
functions in the package. It adds the counts
column, renames columns to
standard names used by the package ("disease", "month", "year", "counts"),
and rearranges columns for consistency.
Arguments
- data
Dataframe. Must contain columns:
patient_disease
(character, unchanged from EpiTrax export)patient_mmwr_year
(integer, unchanged from EpiTrax export)month
(integer, converted frompatient_mmwr_week
bymmwr_week_to_month()
)
Examples
df <- data.frame(
patient_mmwr_year = c(2020L, 2020L),
month = c(1, 2),
patient_disease = c("A", "B")
)
df <- format_epitrax_data(df)