| addDeathFlag | R Documentation |
indexDate will be observed.Add flag for death for individuals. Only death within the same observation
period than indexDate will be observed.
addDeathFlag(
x,
indexDate = "cohort_start_date",
censorDate = NULL,
window = c(0, Inf),
deathFlagName = "death",
name = NULL,
type = "numeric"
)
x |
A table containing individuals in a CDM reference. |
indexDate |
Name of a date column in |
censorDate |
Date or name of a date column in |
window |
Window or windows of time relative to |
deathFlagName |
name of the new column to be added. |
name |
Name of the new table. If |
type |
Type of the created column(s). Counts, days, age, and observation
durations can be |
The original table (x) with one added column per window indicating whether the individual's death record intersects that window. The value of the column can either indicate presence (1 or TRUE), no intersection (0 or FALSE), or NA if the individual is not in observation at any time of the window. The representation depends on type.
library(PatientProfiles)
cdm <- mockPatientProfiles(source = "duckdb")
cdm$cohort1 |>
addDeathFlag()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.