Convert an age (in years) to a bracket.
get_age_bracket(x)
x | Age in years (vector) |
---|
Ordered factor indicating the age bracket
get_age_bracket(21)#> [1] 20-29 #> Levels: 0-19 < 20-29 < 30-39 < 40-49 < 50-59 < 60-69 < 70-79 < 80+#> [1] 0-19 20-29 20-29 20-29 20-29 30-39 30-39 30-39 40-49 40-49 #> Levels: 0-19 < 20-29 < 30-39 < 40-49 < 50-59 < 60-69 < 70-79 < 80+