tx_alluvial: Generate an alluvial plot for treatment data.

Description Usage Arguments Examples

View source: R/tx_alluvial.r

Description

Using a txvis object, plot the sequencing of treatments using an alluvial plot.

Usage

1
2
3
tx_alluvial(txvis, nsequ = NULL, sequence = TRUE, start = NULL,
  end = NULL, interval = "4 months", conflict = "majority",
  tx_cw = 0.05, ...)

Arguments

txvis

An object of class txvis.

nsequ

The maximum number of sequences to plot.

sequence

Boolean. Should treatments plot by sequence (TRUE) or by date.

start

Arguments to pass to reform_dates or reform_seq.

end

Arguments to pass to reform_dates or reform_seq.

interval

Arguments to pass to reform_dates or reform_seq. Default is 4 months.

conflict

Arguments to pass to reform_dates or reform_seq.

tx_cw

Width of the category axis.

...

Arguments to pass to the alluvial function.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
 hlth_data <- create_txvis(patient        = treat$pat_id, 
                           treatment      = treat$treatment,
                           start          = treat$start,
                           end            = treat$end,
                           date_format    = "%d%b%Y",
                           ev_patient     = events$pat_id,
                           events         = events$event,
                           event_date     = events$start,
                           event_end_date = events$end)
                           
 tx_alluvial(hlth_data)
 

johnwilsonICON/TxVis documentation built on May 19, 2019, 5:18 p.m.