# Basic usage
create_agegroups(1:100)
# Custom formatting with upper bounds
create_agegroups(1:100,
breaks_as_lower_bound = FALSE,
interval_format = "{x} to {y}",
first_group_format = "0 to {x}"
)
# Ages 1 to 5 are kept as numbers by collapsing single year groups
create_agegroups(1:10,
age_breaks = c(1, 2, 3, 4, 5, 10),
collapse_single_year_groups = TRUE
)
Run the code above in your browser using DataLab