Skip to contents

nsSank 0.5.0

Major changes

  1. Added union_events: replaces the previous stockpile_events() function, which merged overlapping or adjacent treatment intervals into continuous treatment episodes. union_events preserves that behavior and extends it with a med_levels argument to take the union across different levels within the same treatment class.
  2. Breaking change — stockpile_events rewritten: stockpile_events no longer merges overlapping treatment intervals (use union_events for that). It now resolves overlapping fills by pushing most recent fills forward to begin after the previous ones end, preserving all days of supply. The following breaking changes apply:
    • The function no longer assumes column names state, start, and end. The columns holding treatment name, start date, and stop date must now be specified via the tx_name, tx_start, and tx_stop arguments (defaulting to columns of those same names).
    • The states filter argument has been removed. Users should filter out treatment records they don’t want stockpiled prior to calling this function.
    • The gap argument has been removed. Bridging gaps between different treatment intervals is handled by union_events.
    • The default gap in the old stockpile_events was 1L; union_events defaults to gap = 0L.
    • stockpile_events now accepts a med_levels argument to stockpile across levels of the same treatment class.
  3. Added truncate_events: resolves overlapping fills by truncating prior fills to end the day before a more recent fill begins (i.e., newer fills taking precedence). Accepts a med_levels argument to truncate across different levels of the same treatment class.
  4. Added split_treatment_classes: splits an events data frame into leveled and non-leveled treatments based on a supplied med_levels list.

Bug fixes

  1. Fixed ansible() ignoring its id_var argument when a non-default patient identifier column name was supplied.

nsSank 0.4.0

Major changes

  1. Added create_time_varying_data: converts events and cohort data into a time-varying interval dataset where each row represents a time period per patient with indicator columns for active treatments.
  2. Added plot_sankey: creates an in-R Sankey diagram from events and cohort data.
  3. Added format_sankey_data: Converts events and cohort data into the required JSON format needed to make Sankeys on the Target RWE platform.
  4. Added sankey_counts_table: Tabulates the number of patients in each state at each time point.
  5. Added sankey_transition_counts: Produces a table of transitions between states, showing the starting state, ending state, transition period, and number of patients for each transition
  6. Added filter_gofl: extracts a specific stratum from the list output of plot_sankey(), sankey_counts_table(), or sankey_transition_counts() when gofl_formula is specified
  7. Added union_events: takes the union of overlapping or near-contiguous treatment intervals.
  8. Added stockpile_events: stockpiles events with overlapping or near-contiguous start/end dates.
  9. Added truncate_events: truncates overlapping treatment periods.
  10. Added split_treatment_classes: splits an events dataframe into leveled and non-leveled treatment classes.

Minor Changes

  1. Fixed a bug that prevented sankey_list_maker from correctly passing a custom id_var argument.

nsSank 0.3.5

Minor changes

  1. Fixed bug that dropped “None” states in sunbursts when combine_repeats = FALSE

nsSank 0.3.0

Major changes

  1. Updated sankey_list_maker to tweak the following arguments:
    • weight is a T/F value that indicates whether you want the Sankey weighted or not.
    • censor_vars takes a vector of variables to use for censoring. If named will create states with those names. Default is NULL.
    • absorbing_var takes a vector of variables that will be used for “absorbing” states. Required to be named. Default is NULL. Replaces requirement of having a “death” variable in the cohort.
  2. Updated sunburst_maker and sankey_list_maker to tweak the following arguments:
    • gofl_formula replaces strat_vars and filt_vars. Now you can just enter your own gofl formula for how you want the Sankey filtered.

Minor changes

  1. Fixed bug that kept in None state label when not present.
  2. Fixed bug (mentioned above) that forced users to have a death_date variable.
  3. If variables to be used in the filtering and stratification are stype vectors package will convert to base types.
  4. gofl_formula can use v_nominal, character, or nominal variables. If using a character and there are > 10 unique values, will throw error and force user to convert to nominal.
  5. Always calculates pathways if unweighted (even if there are a lot of states/stages) but throws warning.