Description Usage Arguments Value Examples
Using a txvis
object, plot the sequencing of treatments using an icicle plot.
1 2 |
txvis |
An object of class |
nsample |
The number of patients to show sequence data for. Default is 10. |
aligned |
Should treatment sequences be displayed by date, or from a common origin. Default is FALSE. |
clustered |
Organize treatments so that similar treatments are adjacent to one another. Not implemented. |
events |
Should individual events be superimposed onto the treatment sequences. Defaults to FALSE. |
Returns a ggplot2
object.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | 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)
# Plot without events:
tx_indiv(hlth_data)
# Plot with event data:
tx_indiv(hlth_data, events = TRUE)
# Add additional ggplot2 styline:
library(ggplot2)
tx_indiv(hlth_data) + theme_bw()
# Show many more samples & events, and assign a common start date.
tx_indiv(hlth_data, nsample = 50, aligned = TRUE) +
theme(axis.text.y = element_text(size = 8))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.