powered by
Age grouper
age_grouper(age, interval = 10, min_age = 25, max_age = 75, breaks = NULL, labels = NULL)
A numeric age (in years).
How big should the age range be. 25-34 means interval = 10.
What is the upper bound of the lowest bracket? (min_age = 25 means 'Under 25' will be the lowest bracket.)
min_age = 25
What is the lower bound of the highest bracket? (max_age = 75 means '75+' will be the bracket.)
max_age = 75
Specify breaks manually.
Specify the labels manually.
An ordered factor giving age ranges (separated by hyphens) as specified.
# NOT RUN { age_grouper(42) age_grouper(42, interval = 5, min_age = 20, max_age = 60) # }
Run the code above in your browser using DataLab