Transformation for this was originally written in R in the 00_read_data.R script which references
In the original implementation by Emilie, she just randomly took 1 row (see below) what do you think? @chiachen2019
dominant_serotype_weekly <- dengue_singapore |>
pivot_longer(cols = c("smooth_denv1", "smooth_denv2", "smooth_denv3", "smooth_denv4"), names_to = "serotype", values_to = "proportion") |>
group_by(date) |>
slice(which.max(proportion)) |> # Use slice here to only return one row in cases where there are multiple max
rename(dominant_serotype_weekly = serotype) |>
select(date, dominant_serotype_weekly)
You can see my implementation in the associated PR
Transformation for this was originally written in R in the
00_read_data.R
script which referencesIn the original implementation by Emilie, she just randomly took 1 row (see below) what do you think? @chiachen2019
You can see my implementation in the associated PR