data-raw/helpers.R

#' find unique then source
unique_sort <- function(data) {
    data %>%
        unique() %>%
        sort()
}

#' filter age groups
filter_age_groups <- function(data) {
    data %>%
        subset(
            age_group %in% global_age_groups
        )
}

global_age_groups <- c("0 - 17", "18 - 49", "50 - 64", "65+")

global_seasons <- seq(2010, 2020) %>% lapply(\(x) paste0(x, "-", x + 1))

required_columns <- c("age_group", "season", "value", "lower_ci", "upper_ci")

usethis::use_data(global_age_groups, global_seasons, overwrite = T)
QuartzSoftwareLLC/shiny.fluToolKit documentation built on April 28, 2022, 6:25 a.m.