powered by
Checks that age group labels in a dataset match expected formats.
validate_age_groups(dat)
NULL (invisibly). The function is called for its side effect of stopping execution if invalid age groups are found.
A data frame containing an ageg column with age group labels.
ageg
Expected age group labels are:
Five-year age bands: '00_04', '05_09', ..., '80_84'
Open-ended group: '85'
Special categories: 'total', 'DCO', 'MV'
dat <- data.frame(ageg = c("00_04", "05_09", "10_14")) validate_age_groups(dat)
Run the code above in your browser using DataLab