Create Leading deaths Age Group Column
construct_leading_groups.Rd
This function takes a dataset and a column containing age in integer form, and creates a new column with age group labels.
Examples
data <- data.frame(death2b = c(3, 8, 45, 72))
data <- construct_leading_groups(data, age_col = 'death2b', age_group_col = "age_grp_lead")
print(data)
#> death2b age_grp_lead
#> 1 3 0-4
#> 2 8 5-14
#> 3 45 15-69
#> 4 72 70+