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 with individuals in the cdm.
- dateOfBirthName
dateOfBirth column name.
- missingDay
day of the month assigned to individuals with missing day of birth.
- missingMonth
Month of the year assigned to individuals with missing month of birth.
- imposeDay
TRUE or FALSE. Whether the day of the date of birth will be considered as missing for all the individuals.
- imposeMonth
TRUE or FALSE. Whether the month of the date of birth will be considered as missing for all the individuals.
- name
Name of the new table, if NULL a temporary table is returned.
Examples
# \donttest{
library(PatientProfiles)
cdm <- mockPatientProfiles(source = "duckdb")
cdm$cohort1 |>
addDateOfBirth()
#> # Source: table<og_108_1775495282> [?? x 5]
#> # Database: DuckDB 1.5.1 [unknown@Linux 6.17.0-1008-azure:R 4.5.3/:memory:]
#> cohort_definition_id subject_id cohort_start_date cohort_end_date
#> <int> <int> <date> <date>
#> 1 1 2 1934-04-20 1937-04-14
#> 2 3 3 1965-07-25 1966-01-19
#> 3 1 6 1970-02-11 1979-02-20
#> 4 2 4 1944-02-23 1961-09-17
#> 5 3 10 1967-10-07 1967-11-01
#> 6 1 7 1968-08-01 1968-10-28
#> 7 1 8 1970-04-22 1971-06-24
#> 8 2 5 1927-07-05 1935-05-23
#> 9 1 9 1966-08-11 1971-04-29
#> 10 3 1 1932-09-23 1952-03-02
#> # ℹ 1 more variable: date_of_birth <date>
# }
