Last chance! 50% off unlimited learning
Sale ends in
Erafy a cohort_table collapsing records separated gapEra days or less.
erafyCohort(
cohort,
gapEra,
cohortId = NULL,
nameStyle = "{cohort_name}_{gap_era}",
name = omopgenerics::tableName(cohort)
)
A cohort_table object.
A cohort_table object.
Number of days between two continuous exposures to be considered in the same era.
A cohort definition id to restrict by. If NULL, all cohorts will be included.
String to create the new names of cohorts. Must contain '{cohort_name}' if more than one cohort is present and '{gap_era}' if more than one gapEra is provided.
Name of the new cohort table, it must be a length 1 character vector.
# \donttest{
library(DrugUtilisation)
cdm <- mockDrugUtilisation()
cdm$cohort2 <- cdm$cohort1 |>
erafyCohort(gapEra = 30, name = "cohort2")
cdm$cohort2
settings(cdm$cohort2)
mockDisconnect(cdm)
# }
Run the code above in your browser using DataLab