#' 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.