calc_agegroup: Calculate age groups in years

Description Usage Arguments Value Author(s) Examples

Description

Calculate age groups in years

Usage

1
calc_agegroup(age, breaks = c(0, 10, 20, 30, 40, 50, 60, 70, 80, Inf))

Arguments

age

a numeric vector of ages

breaks

a numeric vector defining break points for age groups (the final value must be infinite)

Value

a factor vector containing age groups in years

Author(s)

Daniel Gardiner (daniel.gardiner@phe.gov.uk)

Examples

1
2
3
4
5
6
7
8
9
# set dummy data

set.seed(2)

age = sample(0:120, 30, replace = TRUE)

# use function

calc_agegroup(age , breaks = c(0, 20, 40, 60, Inf))

DanielGardiner/EpiFunc documentation built on July 25, 2019, 10:53 p.m.