add_age_intervals: Add Age Intervals

View source: R/age.R

add_age_intervalsR Documentation

Add Age Intervals

Description

Add a column (factor) with plain language description of the age range

Usage

add_age_intervals(
  df,
  breaks = NULL,
  age_col = "Age",
  group_col = "AgeGroup",
  under = "Younger than ",
  bridge = " to ",
  over = " or Older",
  factor_na = NULL,
  keep_attrs = FALSE
)

Arguments

df

- data.frame

breaks

- integer - vector of age intervals (passed to cut)

age_col

- character - name of column with numeric ages

group_col

- character - name of factor column with text age ranges

under

- character - text to use for less/younger than

bridge

- character - text to use between the min and max

over

- character - text to use for greater/older than

factor_na

- character - text to use for NA values

Value

data.frame


JahNorr/orrr documentation built on Jan. 29, 2025, 5:11 p.m.