aec_tto_plot | R Documentation |
Plots the stacked area chart for time-to-onset for the AEC Although the function takes only two arguments (a data frame containing the proportion of cases for inpatients, by time to onset and financial year), it relies on the presence of the following variables to that data frame, which must be precisely named:
fyear6
The financial year in format YYYY/YY
tto_group
Grouped time to onset variable, to allow side-by-side bars
pc
Proportion of cases
aec_tto_plot(x, collection = NULL)
x |
A data frame as specified above. |
collection |
One of "mrsa", "mssa", "cdi" or "ecoli" |
A ggplot object
## Not run:
dat <- structure(list(fyear6 = c(201011L, 201011L, 201011L, 201516L, 201516L,
201516L),
tto_group = structure(c(3L, 2L, 1L, 3L, 2L, 1L),
.Label = c("< 2 days", "2-6 days", ">= 7 days"), class = "factor"),
pc = c(33L, 33L, 34L, 20L, 30L, 50L)), class = "data.frame",
row.names = c(NA, -6L), .Names = c("fyear6", "tto_group", "pc"))
p <- aec_tto_plot(dat)
p
p <- aec_tto_plot(dat, collection = "mrsa")
p
p <- aec_tto_plot(dat, collection = "cdi")
p
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.