View source: R/addCohortEvent.R
| addCohortEventDate | R Documentation |
addCohortEventDate() finds the first or last event in each window.
When no event is observed before the applicable boundary, the event is
reported as "end_of_observation" if the observation period boundary is
reached or "censor" if the window boundary or censorDate is reached. The
date value represents that boundary.
addCohortEventDate(
x,
targetCohortTable,
targetCohortId = NULL,
indexDate = "cohort_start_date",
censorDate = NULL,
targetDate = "cohort_start_date",
order = "first",
window = c(0, Inf),
multipleEvents = NULL,
nameStyle = "{value}_{window_name}",
name = NULL
)
x |
A table containing individuals in a CDM reference. |
targetCohortTable |
Name of the cohort table to intersect with. |
targetCohortId |
Cohort definition IDs to include from
|
indexDate |
Name of a date column in |
censorDate |
Date or name of a date column in |
targetDate |
Name or names of date columns in the target tables to use for the intersection. |
order |
Which record to use when multiple records occur in a window:
|
window |
Window or windows of time relative to |
multipleEvents |
How events occurring on the same date are handled. If
|
nameStyle |
Naming pattern for the added columns. It must contain
|
name |
Name of the new table. If |
x with an event column and a date column for every window.
library(PatientProfiles)
cdm <- mockPatientProfiles(source = "duckdb")
cdm$cohort1 |>
addCohortEventDate(targetCohortTable = "cohort2")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.