powered by
Compute the age of the individuals at a certain date
addAge( x, indexDate = "cohort_start_date", ageName = "age", ageGroup = NULL, ageMissingMonth = 1, ageMissingDay = 1, ageImposeMonth = FALSE, ageImposeDay = FALSE, ageUnit = "years", missingAgeGroupValue = "None", name = NULL )
tibble with the age column added.
Table with individuals in the cdm.
Variable in x that contains the date to compute the demographics characteristics.
Age variable name.
if not NULL, a list of ageGroup vectors.
Month of the year assigned to individuals with missing month of birth.
day of the month assigned to individuals with missing day of birth.
TRUE or FALSE. Whether the month of the date of birth will be considered as missing for all the individuals.
TRUE or FALSE. Whether the day of the date of birth will be considered as missing for all the individuals.
Unit for age it can either be 'years', 'months' or 'days'.
Value to include if missing age.
Name of the new table, if NULL a temporary table is returned.
# \donttest{ library(PatientProfiles) cdm <- mockPatientProfiles(source = "duckdb") cdm$cohort1 |> addAge() # }
Run the code above in your browser using DataLab