Controls how adjacent cohort episodes are collapsed (merged) and optionally constrains the study window. Episodes separated by fewer than eraDays days are merged.

era(eraDays = 0L, studyStartDate = NULL, studyEndDate = NULL)

Arguments

eraDays

Gap in days between consecutive episodes below which they are collapsed into a single era. Default 0L (no collapse).

studyStartDate

Optional date to truncate cohort membership before this date.

studyEndDate

Optional date to truncate cohort membership after this date.

Value

A CohortEra object.

See also

Examples

era(eraDays = 30L)
#> An object of class "CohortEra"
#> Slot "eraDays":
#> [1] 30
#> 
#> Slot "studyStartDate":
#> [1] NA
#> 
#> Slot "studyEndDate":
#> [1] NA
#> 
era(eraDays = 99999L)  # Occ cohort: collapse all episodes into one long era
#> An object of class "CohortEra"
#> Slot "eraDays":
#> [1] 99999
#> 
#> Slot "studyStartDate":
#> [1] NA
#> 
#> Slot "studyEndDate":
#> [1] NA
#>