addDateOfBirth: Add a column with the individual birth date

View source: R/addDemographics.R

addDateOfBirthR Documentation

Add a column with the individual birth date

Description

Add a column with the individual birth date

Usage

addDateOfBirth(
  x,
  dateOfBirthName = "date_of_birth",
  missingDay = 1,
  missingMonth = 1,
  imposeDay = FALSE,
  imposeMonth = FALSE,
  name = NULL
)

Arguments

x

Table in the cdm that contains 'person_id' or 'subject_id'.

dateOfBirthName

Name of the column to be added with the date of birth.

missingDay

Day of the individuals with no or imposed day of birth.

missingMonth

Month of the individuals with no or imposed month of birth.

imposeDay

Whether to impose day of birth.

imposeMonth

Whether to impose month of birth.

name

Name of the new table, if NULL a temporary table is returned.

Value

The function returns the table x with an extra column that contains the date of birth.

Examples


library(PatientProfiles)
cdm <- mockPatientProfiles()
cdm$cohort1 %>%
  addDateOfBirth()
mockDisconnect(cdm = cdm)


PatientProfiles documentation built on Oct. 30, 2024, 9:13 a.m.