View source: R/addDemographics.R
| addAge | R Documentation |
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,
type = "numeric"
)
x |
A table containing individuals in a CDM reference. |
indexDate |
Name of a date column in |
ageName |
Name of the age column to add. |
ageGroup |
If not |
ageMissingMonth |
Month of the year assigned when month of birth is missing. |
ageMissingDay |
Day of the month assigned when day of birth is missing. |
ageImposeMonth |
If |
ageImposeDay |
If |
ageUnit |
Unit in which to express age: |
missingAgeGroupValue |
Value to use when age is missing. |
name |
Name of the new table. If |
type |
Type of the created column(s). Counts, days, age, and observation
durations can be |
tibble with the age column added.
library(PatientProfiles)
cdm <- mockPatientProfiles(source = "duckdb")
cdm$cohort1 |>
addAge()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.