View source: R/aec_ec_primary_focus_plot.R
aec_ec_source_plot | R Documentation |
Although the function takes a single argument (a data frame),
it relies on the presence of several variables to that data frame:
* tto_group
The grouped time to onset, generated by group_tto_bacteraemia
* primary_focus
One of the primary foci in group_source_bacteraemia
* pc
The percentage that the focus occurs within tto_group
aec_ec_source_plot(x)
x |
A data frame |
A ggplot2 object
group_tto_bacteraemia
group_source_bacteraemia
## Not run:
dat <- structure(list(
tto_group = structure(c(1L, 1L, 1L, 1L, 1L, 1L,
2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L),
.Label = c("<2", "2-6", "ge7"), class = "factor"),
primary_focus = structure(c(1L, 2L, 3L, 4L, 5L, 6L, 1L,
2L, 3L, 4L, 5L, 6L, 1L, 2L, 3L, 4L, 5L, 6L),
.Label = c("gastro", "hepatobil", "other", "respiratory", "unknown", "uti"),
class = "factor"),
pc = c(20, 20, 20, 20, 10, 10,
30, 20, 10, 10, 10, 20, 50, 10, 10, 10, 10,
10)), .Names = c("tto_group", "primary_focus", "pc"),
class = "data.frame", row.names = c(NA, -18L))
pal <- phecharts::brewer_phe("phe", length(levels(dat$primary_focus)))
p <- aec_ec_source_plot(dat)
p
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.