Description Usage Arguments Value Examples
Using a txvis
object, plot the sequencing of treatments using an icicle plot.
1 2 3 |
txvis |
An object of class |
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? |
tx_color |
A |
A ggplot2
object.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | 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_icicle(hlth_data)
# Add additional ggplot2 styline:
tx_indiv(hlth_data) + ggplot2::theme_bw()
# Use a customized color palette:
library(RColorBrewer)
colors <- c("#FFFFFF", brewer.pal(length(levels(hlth_data[[1]]$tx)), 'Accent'))
tx_icicle(hlth_data, tx_color = colors)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.