It creates columns to indicate overlap information between two tables
Source:R/addIntersect.R
addIntersect.Rd
`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.
Examples
# \donttest{
library(PatientProfiles)
cdm <- mockPatientProfiles()
result <- cdm$cohort1 %>%
addIntersect(tableName = "cohort2", value = "date") %>%
dplyr::collect()
#> Warning: `addIntersect()` was deprecated in PatientProfiles 0.7.0.
CDMConnector::cdmDisconnect(cdm = cdm)
# }