Skip to contents

Simply makes more meaningful labels on the age column. Assumes that the age column was created from the convert_ager27() function. Allows for using tidyr::complete() even when some age/year/race combinations have no observations.

Usage

categorize_age_5(age_column)

Arguments

age_column

age column created from convert_ager27()

Value

factor

Examples

categorize_age_5(seq(0, 70, 5))
#>  [1] 0-4   5-9   10-14 15-19 20-24 25-29 30-34 35-39 40-44 45-49 50-54 55-59
#> [13] 60-64 65-69 70-74
#> 18 Levels: 0-4 < 5-9 < 10-14 < 15-19 < 20-24 < 25-29 < 30-34 < ... < 85+