Skip to contents

Mostly used for plot labelling

Usage

limits_to_agegroups(x, limits = sort(unique(x)))

Arguments

x

age limits to transform

limits

lower age limits; if not given, will use all limits in x

Value

Age groups (limits separated by dashes)

Examples

limits_to_agegroups(c(0, 5, 10))
#> [1] 0-4 5-9 10+
#> Levels: 0-4 < 5-9 < 10+