Convert events data to sankey id timed data

sankey_id_events(
  cohort,
  evts,
  stages,
  id_var = "patient_id",
  index_var = "index_date",
  states = NULL,
  select_event = "combine"
)

Arguments

cohort

A tibble. Cohort file with one record per subject.

evts

A tibble. Events file with one record per state/time. Returned from `convert_tagged_cdf``

stages

Numeric. Timepoints after index to evalute treatment states.

id_var

String. Variable name of the id/grouping variable.

index_var

Date. Indicates cohort_file date variable name per subject when event ordering should begin.

states

Character. Treatment states to include in sunburst. Default NULL uses all treatments in data.

select_event

Character. How should events be selected at each time point? Default "combine" returns all events that occurred at the time point. "first" takes the first event, "last" takes the last (most recent) event.

Value

List with id data and states used to make the numeric.