Learn R Programming

cancerradarr (version 3.0.0)

validate_age_groups: Validate Age Group Labels

Description

Checks that age group labels in a dataset match expected formats.

Usage

validate_age_groups(dat)

Value

NULL (invisibly). The function is called for its side effect of stopping execution if invalid age groups are found.

Arguments

dat

A data frame containing an ageg column with age group labels.

Details

Expected age group labels are:

  • Five-year age bands: '00_04', '05_09', ..., '80_84'

  • Open-ended group: '85'

  • Special categories: 'total', 'DCO', 'MV'

Examples

Run this code
dat <- data.frame(ageg = c("00_04", "05_09", "10_14"))
validate_age_groups(dat)

Run the code above in your browser using DataLab