Reshape data frame with each year as a separate column
reshape_annual_wide.Rd
'reshape_annual_wide' reshapes a given data frame with diseases for rows and years for columns.
Examples
df <- data.frame(
disease = c("A", "A", "B"),
year = c(2020, 2021, 2020),
counts = c(5, 7, 8)
)
reshape_annual_wide(df)
#> disease 2020 2021
#> 1 A 5 7
#> 3 B 8 0