Learn R Programming

diyar (version 0.4.3)

episode_group: Group dated events into episodes.

Description

Assign unique identifiers to dated events based on case definitions.

These functions are no longer supported. Please use episodes instead.

Usage

episode_group(df, ..., episode_type = "fixed")

fixed_episodes( date, case_length = Inf, episode_unit = "days", to_s4 = TRUE, case_overlap_methods = 8, deduplicate = FALSE, display = "none", bi_direction = FALSE, recurrence_length = case_length, recurrence_overlap_methods = case_overlap_methods, include_index_period = TRUE, ..., overlap_methods = 8, overlap_method = 8, x )

rolling_episodes( date, case_length = Inf, recurrence_length = case_length, episode_unit = "days", to_s4 = TRUE, case_overlap_methods = 8, recurrence_overlap_methods = case_overlap_methods, deduplicate = FALSE, display = "none", bi_direction = FALSE, include_index_period = TRUE, ..., overlap_methods = 8, overlap_method = 8, x )

Value

epid; list

Arguments

df

[data.frame]. Deprecated. One or more datasets appended together. See Details.

...

Arguments passed to episodes.

episode_type

[character]. Options are "fixed" (default), "rolling" or "recursive". See Details.

date

[date|datetime|integer|number_line]. Event date or period.

case_length

[integer|number_line]. Duration from index event distinguishing one "case" from another. This is the case window.

episode_unit

[character]. Time units for case_length and recurrence_length. Options are "seconds", "minutes", "hours", "days" (default), "weeks", "months" or "years". See diyar::episode_unit.

to_s4

[logical]. Deprecated. Output type - epid (TRUE) or data.frame (FALSE).

case_overlap_methods

[character|integer]. Methods of overlap considered when tracking duplicates of "case" events. See (overlaps)

deduplicate

[logical]. Deprecated. If TRUE, "duplicate" events are excluded from the epid.

display

[character]. The progress messages printed on screen. Options are; "none" (default), "progress", "stats", "none_with_report", "progress_with_report" or "stats_with_report".

bi_direction

[logical]. Deprecated. If TRUE, "duplicate" events before and after the index event are tracked.

recurrence_length

[integer|number_line]. Duration from the last "duplicate" event distinguishing a "recurrent" event from its index event. This is the recurrence window.

recurrence_overlap_methods

[character|integer]. Methods of overlap considered when tracking duplicates of "recurrent" events. See (overlaps)

include_index_period

[logical]. Deprecated. If TRUE, events overlapping with the index event or period are linked even if they are outside the cut-off period.

overlap_methods

[character]. Deprecated. Please use case_overlap_methods or recurrence_overlap_methods. Methods of overlap considered when tracking duplicate event. See (overlaps)

overlap_method

[character]. Deprecated. Please use case_overlap_methods or recurrence_overlap_methods. Methods of overlap considered when tracking event. All event are checked by the same set of overlap_method.

x

[date|datetime|integer|number_line]. Deprecated. Record date or period. Please use date.

Details

These functions are no longer supported. Please use episodes instead.

episode_group, fixed_episodes and rolling_episodes are superseded by episodes.

See Also

episodes

Examples

Run this code
data(infections)
data(hospital_admissions)

# One 16-day (15-day difference) fixed episode per type of infection
fixed_episodes(date = infections$date,
               strata = infections$infection,
               case_length = 15,
               episodes_max = 1)

# Multiple 16-day episodes with an 11-day recurrence period
rolling_episodes(date = infections$date,
                 case_length = 15,
                 recurrence_length = 10)

# Overlapping episodes of hospital stays
hospital_admissions$admin_period <-
  number_line(hospital_admissions$admin_dt,
              hospital_admissions$discharge_dt)
hospital_admissions$epi_length <-
  index_window(hospital_admissions$admin_period)

episode_group(hospital_admissions,
              date = admin_period,
              case_length = epi_length,
              case_overlap_methods = "inbetween")

Run the code above in your browser using DataLab