View source: R/addDemographicsQuery.R
| addAgeQuery | R Documentation |
Same as addAge(), except query is not computed to a table.
addAgeQuery(
x,
indexDate = "cohort_start_date",
ageName = "age",
ageGroup = NULL,
ageMissingMonth = 1,
ageMissingDay = 1,
ageImposeMonth = FALSE,
ageImposeDay = FALSE,
ageUnit = "years",
missingAgeGroupValue = "None"
)
x |
Table with individuals in the cdm. |
indexDate |
Variable in x that contains the date to compute the demographics characteristics. |
ageName |
Age variable name. |
ageGroup |
if not NULL, a list of ageGroup vectors. |
ageMissingMonth |
Month of the year assigned to individuals with missing month of birth. |
ageMissingDay |
day of the month assigned to individuals with missing day of birth. |
ageImposeMonth |
TRUE or FALSE. Whether the month of the date of birth will be considered as missing for all the individuals. |
ageImposeDay |
TRUE or FALSE. Whether the day of the date of birth will be considered as missing for all the individuals. |
ageUnit |
Unit for age it can either be 'years', 'months' or 'days'. |
missingAgeGroupValue |
Value to include if missing age. |
tibble with the age column added.
library(PatientProfiles)
cdm <- mockPatientProfiles(source = "duckdb")
cdm$cohort1 |>
addAgeQuery()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.