erafyCohort {DrugUtilisation} | R Documentation |
Erafy a cohort_table collapsing records separated gapEra days or less.
Description
Erafy a cohort_table collapsing records separated gapEra days or less.
Usage
erafyCohort(
cohort,
gapEra,
cohortId = NULL,
nameStyle = "{cohort_name}_{gap_era}",
name = omopgenerics::tableName(cohort)
)
Arguments
cohort |
A cohort_table object. |
gapEra |
Number of days between two continuous exposures to be considered in the same era. |
cohortId |
A cohort definition id to restrict by. If NULL, all cohorts will be included. |
nameStyle |
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 |
Name of the new cohort table, it must be a length 1 character vector. |
Value
A cohort_table object.
Examples
cdm <- mockDrugUtilisation()
cdm$cohort2 <- cdm$cohort1 |>
erafyCohort(gapEra = 30, name = "cohort2")
cdm$cohort2
settings(cdm$cohort2)
mockDisconnect(cdm)
[Package DrugUtilisation version 0.8.0 Index]