tx_d3alluvial: Generate an alluvial plot for treatment data using D3.js.

Description Usage Arguments Examples

View source: R/tx_d3alluv.r

Description

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

Usage

1
2
3
tx_d3alluvial(txvis, nsequ = NULL, seq.v.dat = "seq", start = NULL,
  end = NULL, interval = "month", conflict = "majority",
  link_coloring = "from")

Arguments

txvis

An object of class txvis.

nsequ

The number of sequences to be shown (default is 4)

seq.v.dat

Should the data be plotted by sequence order or by date?

start

If supplied the data will be truncated to all sequences after a start date.

end

If supplied the data will be truncated to all sequences before the end date.

interval

Length of time for intervening intervals for data plotted by date.

conflict

If two treatments fall within the same date interval, which should be displayed?

link_coloring

Used to indicate the source of the link (path) coloring. "from" (default) colors based on the treatment source, or "to" colors based on destination, or "none".

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)
                           
 # Basic plotting:                          
 tx_d3alluvial(hlth_data)

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