limits_to_agegroups: Convert lower age limits to age groups.

View source: R/limits_to_agegroups.R

limits_to_agegroupsR Documentation

Convert lower age limits to age groups.

Description

Mostly used for plot labelling

Usage

limits_to_agegroups(
  x,
  limits = sort(unique(x)),
  notation = c("dashes", "brackets")
)

Arguments

x

age limits to transform

limits

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

notation

whether to use bracket notation, e.g. [0,4) or dash notation, e.g. 0-4)

Value

Age groups as specified in notation

Examples

limits_to_agegroups(c(0, 5, 10))

sbfnk/socialmixr documentation built on Feb. 26, 2025, 8:55 p.m.