Description Usage Arguments See Also Examples
Standardizes age groups to match seer_std_ages. Adds an age_group
column,
or overwites the existing age_group
column if present. The age_var
column
can be either an actual age or an age group. If the column is numeric, it
assumed to be an actual age, otherwise if it contains any non-numeric
characters it is assumed to be an age group that will be expanded using
separate_age_groups()
. If multiple standardized age groups match a given age,
the function will throw an error.
1 2 | standardize_age_groups(data = NULL, age_group = age_group,
std_age_groups = fcds_const("age_group"), ...)
|
data |
A data frame. |
age_group |
The column containing age or age group. This column will be
overwritten if named |
std_age_groups |
Standard age groups, in the desired order. |
... |
Arguments passed on to
|
format_age_groups()
for the specification of the age group label
format and to convert age boundaries into age group labels.
Other age processors: complete_age_groups
,
filter_age_groups
,
format_age_groups
,
recode_age_groups
,
separate_age_groups
1 2 3 4 5 | dplyr::tibble(
id = 1:4,
age_group = c("0 - 4", "10-14", "65-69", "85+")
) %>%
standardize_age_groups()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.