addIntersect {PatientProfiles} | R Documentation |
It creates columns to indicate overlap information between two tables
Description
'r lifecycle::badge("deprecated")'
Usage
addIntersect(
x,
tableName,
value,
filterVariable = NULL,
filterId = NULL,
idName = NULL,
window = list(c(0, Inf)),
indexDate = "cohort_start_date",
censorDate = NULL,
targetStartDate = startDateColumn(tableName),
targetEndDate = endDateColumn(tableName),
order = "first",
nameStyle = "{value}_{id_name}_{window_name}"
)
Arguments
x |
Table with individuals in the cdm. |
tableName |
name of the cohort that we want to check for overlap. |
value |
value of interest to add: it can be count, flag, date or time. |
filterVariable |
the variable that we are going to use to filter (e.g. cohort_definition_id). |
filterId |
the value of filterVariable that we are interested in, it can be a vector. |
idName |
the name of each filterId, must have same length than filterId. |
window |
window to consider events of. |
indexDate |
Variable in x that contains the date to compute the intersection. |
censorDate |
whether to censor overlap events at a date column of x. |
targetStartDate |
date of reference in cohort table, either for start (in overlap) or on its own (for incidence). |
targetEndDate |
date of reference in cohort table, either for end (overlap) or NULL (if incidence). |
order |
last or first date to use for date/time calculations. |
nameStyle |
naming of the added column or columns, should include required parameters. |
Value
table with added columns with overlap information.
Examples
library(PatientProfiles)
cdm <- mockPatientProfiles()
result <- cdm$cohort1 %>%
addIntersect(tableName = "cohort2", value = "date") %>%
dplyr::collect()
CDMConnector::cdmDisconnect(cdm = cdm)