Description Usage Arguments See Also Examples
Filters data to include persons with ages in the range between age_gt
and
age_lt
. If age_group
has not been expanded into min and max ages of
the range, the input data is first passed to separate_age_groups()
. If the
boundary age lies within a group, that group is not included in the output.
1 2 | filter_age_groups(data, age_gt = 0, age_lt = Inf,
age_group = age_group)
|
data |
A data frame. |
age_gt |
Youngest age (inclusive). |
age_lt |
Eldest age (inclusive). |
age_group |
Unquoted column name containing the age grouping. |
Other age processors: complete_age_groups
,
format_age_groups
,
recode_age_groups
,
separate_age_groups
,
standardize_age_groups
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | d_age_group <- dplyr::tibble(
id = 1:4,
age_group = c("0 - 4", "10 - 14", "65 - 69", "85+")
)
d_age_group %>%
filter_age_groups(age_gt = 0, age_lt = 15)
d_age_group %>%
filter_age_groups(age_gt = 65)
# Notice that the "65 - 69" group is *not* included
d_age_group %>%
filter_age_groups(age_lt = 66)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.