View source: R/addDemographics.R
| addDemographics | R Documentation |
Compute demographic characteristics at a certain date
addDemographics(
x,
indexDate = "cohort_start_date",
age = TRUE,
ageName = "age",
ageMissingMonth = 1,
ageMissingDay = 1,
ageImposeMonth = FALSE,
ageImposeDay = FALSE,
ageUnit = "years",
ageGroup = NULL,
missingAgeGroupValue = "None",
sex = TRUE,
sexName = "sex",
missingSexValue = "None",
priorObservation = TRUE,
priorObservationName = "prior_observation",
priorObservationType = "days",
futureObservation = TRUE,
futureObservationName = "future_observation",
futureObservationType = "days",
dateOfBirth = FALSE,
dateOfBirthName = "date_of_birth",
name = NULL,
type = "numeric"
)
x |
A table containing individuals in a CDM reference. |
indexDate |
Name of a date column in |
age |
If |
ageName |
Name of the age column to add. |
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: |
ageGroup |
If not |
missingAgeGroupValue |
Value to use when age is missing. |
sex |
If |
sexName |
Name of the sex column to add. |
missingSexValue |
Value to use when sex is missing. |
priorObservation |
If |
priorObservationName |
Name of the prior-observation column to add. |
priorObservationType |
Whether to return a |
futureObservation |
If |
futureObservationName |
Name of the future-observation column to add. |
futureObservationType |
Whether to return a |
dateOfBirth |
If |
dateOfBirthName |
Name of the date-of-birth column to add. |
name |
Name of the new table. If |
type |
Type of the created column(s). Counts, days, age, and observation
durations can be |
cohort table with the added demographic information columns.
library(PatientProfiles)
cdm <- mockPatientProfiles(source = "duckdb")
cdm$cohort1 |>
addDemographics()
cdm$cohort1 |>
addDemographics(indexDate = as.Date("2010-01-01"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.