Title: | A Certe R Package for Convenient Plotting |
---|---|
Description: | A Certe R Package for fast and convenient plotting based on 'plot2', by providing wrappers around 'tidyverse' packages such as 'ggplot2', while also providing plotting in the Certe organisational style. This package is part of the 'certedata' universe. |
Authors: | Matthijs S. Berends [aut, cre], Erwin E. A. Hassing [aut], Certe Medical Diagnostics & Advice Foundation [cph, fnd] |
Maintainer: | Matthijs S. Berends <[email protected]> |
License: | GPL-2 |
Version: | 2.0.1 |
Built: | 2024-11-10 03:15:10 UTC |
Source: | https://github.com/certe-medical-epidemiology/certeplot2 |
plot2()
These are the implemented methods for different S3 classes to be used in plot2()
. Since they have an extensive list of arguments, they are placed here on a separate manual page.
## S3 method for class 'bug_drug_combinations' plot2( .data, x = ab, y = value, category = name, facet = mo, type = "column", x.title = FALSE, y.title = FALSE, category.title = NULL, title = NULL, subtitle = NULL, caption = NULL, tag = NULL, title.linelength = 60, title.colour = getOption("plot2.colour_font_primary", "black"), subtitle.linelength = 60, subtitle.colour = getOption("plot2.colour_font_secondary", "grey35"), na.replace = "", na.rm = FALSE, facet.position = "top", facet.fill = NULL, facet.bold = TRUE, facet.italic = FALSE, facet.size = 10, facet.margin = 8, facet.repeat_lbls_x = TRUE, facet.repeat_lbls_y = TRUE, facet.fixed_y = NULL, facet.fixed_x = TRUE, facet.drop = FALSE, facet.nrow = NULL, facet.relative = FALSE, x.date_breaks = NULL, x.date_labels = NULL, x.date_remove_years = NULL, category.focus = NULL, colour = get_colour("certe_sir2", 7), colour_fill = NULL, colour_opacity = 0, x.lbl_angle = ifelse(horizontal, 0, 90), x.lbl_align = NULL, x.lbl_italic = FALSE, x.lbl_taxonomy = TRUE, x.remove = FALSE, x.position = "bottom", x.max_items = Inf, x.max_txt = "(rest, x%n)", category.max_items = Inf, category.max_txt = "(rest, x%n)", facet.max_items = Inf, facet.max_txt = "(rest, x%n)", x.breaks = NULL, x.n_breaks = NULL, x.transform = "identity", x.expand = NULL, x.limits = NULL, x.labels = NULL, x.character = NULL, x.drop = FALSE, x.mic = FALSE, x.zoom = FALSE, y.remove = FALSE, y.24h = FALSE, y.age = FALSE, y.scientific = NULL, y.percent = FALSE, y.percent_break = 0.1, y.breaks = NULL, y.n_breaks = NULL, y.limits = NULL, y.labels = NULL, y.expand = NULL, y.transform = "identity", y.position = "left", y.zoom = FALSE, y_secondary = NULL, y_secondary.type = type, y_secondary.title = TRUE, y_secondary.colour = "certeroze", y_secondary.colour_fill = "certeroze6", y_secondary.scientific = NULL, y_secondary.percent = FALSE, y_secondary.labels = NULL, category.labels = NULL, category.percent = FALSE, category.breaks = NULL, category.limits = NULL, category.expand = 0, category.midpoint = NULL, category.transform = "identity", category.date_breaks = NULL, category.date_labels = NULL, category.character = NULL, x.sort = NULL, category.sort = FALSE, facet.sort = TRUE, x.complete = NULL, category.complete = NULL, facet.complete = NULL, datalabels = TRUE, datalabels.round = ifelse(y.percent, 2, 1), datalabels.format = "%n", datalabels.colour = "grey25", datalabels.colour_fill = NULL, datalabels.size = (3 * text_factor), datalabels.angle = 0, datalabels.lineheight = 1, decimal.mark = dec_mark(), big.mark = big_mark(), summarise_function = base::sum, stacked = FALSE, stackedpercent = TRUE, horizontal = TRUE, reverse = TRUE, smooth = NULL, smooth.method = NULL, smooth.formula = NULL, smooth.se = TRUE, smooth.level = 0.95, smooth.alpha = 0.25, smooth.linewidth = 0.75, smooth.linetype = 3, smooth.colour = NULL, size = NULL, linetype = 1, linewidth = NULL, binwidth = NULL, width = NULL, jitter_seed = NA, violin_scale = "count", legend.position = NULL, legend.title = NULL, legend.reverse = TRUE, legend.barheight = 6, legend.barwidth = 1.5, legend.nbin = 300, legend.italic = FALSE, sankey.node_width = 0.15, sankey.node_whitespace = 0.03, sankey.alpha = 0.5, sankey.remove_axes = NULL, zoom = FALSE, sep = " / ", print = FALSE, text_factor = 1, font = getOption("plot2.font"), theme = getOption("plot2.theme", "theme_minimal2"), background = getOption("plot2.colour_background", "white"), markdown = TRUE, data = NULL, minimum = 30, remove_intrinsic_resistant = TRUE, language = "nl", ... ) ## S3 method for class 'antibiogram' plot2( .data, x = NULL, y = NULL, category = NULL, facet = NULL, type = NULL, x.title = NULL, y.title = NULL, category.title = NULL, title = NULL, subtitle = NULL, caption = NULL, tag = NULL, title.linelength = 60, title.colour = getOption("plot2.colour_font_primary", "black"), subtitle.linelength = 60, subtitle.colour = getOption("plot2.colour_font_secondary", "grey35"), na.replace = "", na.rm = FALSE, facet.position = "top", facet.fill = NULL, facet.bold = TRUE, facet.italic = FALSE, facet.size = 10, facet.margin = 8, facet.repeat_lbls_x = TRUE, facet.repeat_lbls_y = TRUE, facet.fixed_y = NULL, facet.fixed_x = TRUE, facet.drop = FALSE, facet.nrow = NULL, facet.relative = FALSE, x.date_breaks = NULL, x.date_labels = NULL, x.date_remove_years = NULL, category.focus = NULL, colour = getOption("plot2.colour", "ggplot2"), colour_fill = NULL, colour_opacity = 0, x.lbl_angle = 0, x.lbl_align = NULL, x.lbl_italic = FALSE, x.lbl_taxonomy = FALSE, x.remove = FALSE, x.position = "bottom", x.max_items = Inf, x.max_txt = "(rest, x%n)", category.max_items = Inf, category.max_txt = "(rest, x%n)", facet.max_items = Inf, facet.max_txt = "(rest, x%n)", x.breaks = NULL, x.n_breaks = NULL, x.transform = "identity", x.expand = NULL, x.limits = NULL, x.labels = NULL, x.character = NULL, x.drop = FALSE, x.mic = FALSE, x.zoom = FALSE, y.remove = FALSE, y.24h = FALSE, y.age = FALSE, y.scientific = NULL, y.percent = FALSE, y.percent_break = 0.1, y.breaks = NULL, y.n_breaks = NULL, y.limits = NULL, y.labels = NULL, y.expand = NULL, y.transform = "identity", y.position = "left", y.zoom = FALSE, y_secondary = NULL, y_secondary.type = type, y_secondary.title = TRUE, y_secondary.colour = "certeroze", y_secondary.colour_fill = "certeroze6", y_secondary.scientific = NULL, y_secondary.percent = FALSE, y_secondary.labels = NULL, category.labels = NULL, category.percent = FALSE, category.breaks = NULL, category.limits = NULL, category.expand = 0, category.midpoint = NULL, category.transform = "identity", category.date_breaks = NULL, category.date_labels = NULL, category.character = NULL, x.sort = NULL, category.sort = TRUE, facet.sort = TRUE, x.complete = NULL, category.complete = NULL, facet.complete = NULL, datalabels = TRUE, datalabels.round = ifelse(y.percent, 2, 1), datalabels.format = "%n", datalabels.colour = "grey25", datalabels.colour_fill = NULL, datalabels.size = (3 * text_factor), datalabels.angle = 0, datalabels.lineheight = 1, decimal.mark = dec_mark(), big.mark = big_mark(), summarise_function = base::sum, stacked = FALSE, stackedpercent = FALSE, horizontal = FALSE, reverse = horizontal, smooth = NULL, smooth.method = NULL, smooth.formula = NULL, smooth.se = TRUE, smooth.level = 0.95, smooth.alpha = 0.25, smooth.linewidth = 0.75, smooth.linetype = 3, smooth.colour = NULL, size = NULL, linetype = 1, linewidth = NULL, binwidth = NULL, width = NULL, jitter_seed = NA, violin_scale = "count", legend.position = NULL, legend.title = NULL, legend.reverse = FALSE, legend.barheight = 6, legend.barwidth = 1.5, legend.nbin = 300, legend.italic = FALSE, sankey.node_width = 0.15, sankey.node_whitespace = 0.03, sankey.alpha = 0.5, sankey.remove_axes = NULL, zoom = FALSE, sep = " / ", print = FALSE, text_factor = 1, font = getOption("plot2.font"), theme = getOption("plot2.theme", "theme_minimal2"), background = getOption("plot2.colour_background", "white"), markdown = TRUE, data = NULL, ... ) ## S3 method for class 'sir_df' plot2( .data, x = NULL, y = isolates, category = interpretation, facet = antibiotic, type = "column", x.title = TRUE, y.title = FALSE, category.title = NULL, title = FALSE, subtitle = NULL, caption = NULL, tag = NULL, title.linelength = 60, title.colour = getOption("plot2.colour_font_primary", "black"), subtitle.linelength = 60, subtitle.colour = getOption("plot2.colour_font_secondary", "grey35"), na.replace = "", na.rm = FALSE, facet.position = "top", facet.fill = NULL, facet.bold = TRUE, facet.italic = FALSE, facet.size = 10, facet.margin = 8, facet.repeat_lbls_x = TRUE, facet.repeat_lbls_y = TRUE, facet.fixed_y = NULL, facet.fixed_x = TRUE, facet.drop = FALSE, facet.nrow = NULL, facet.relative = FALSE, x.date_breaks = NULL, x.date_labels = NULL, x.date_remove_years = NULL, category.focus = NULL, colour = get_colour("certe_sir2", 5), colour_fill = NULL, colour_opacity = 0, x.lbl_angle = 0, x.lbl_align = NULL, x.lbl_italic = FALSE, x.lbl_taxonomy = TRUE, x.remove = FALSE, x.position = "bottom", x.max_items = Inf, x.max_txt = "(rest, x%n)", category.max_items = Inf, category.max_txt = "(rest, x%n)", facet.max_items = Inf, facet.max_txt = "(rest, x%n)", x.breaks = NULL, x.n_breaks = NULL, x.transform = "identity", x.expand = NULL, x.limits = NULL, x.labels = NULL, x.character = NULL, x.drop = FALSE, x.mic = FALSE, x.zoom = FALSE, y.remove = FALSE, y.24h = FALSE, y.age = FALSE, y.scientific = NULL, y.percent = FALSE, y.percent_break = 0.1, y.breaks = NULL, y.n_breaks = NULL, y.limits = NULL, y.labels = NULL, y.expand = NULL, y.transform = "identity", y.position = "left", y.zoom = FALSE, y_secondary = NULL, y_secondary.type = type, y_secondary.title = TRUE, y_secondary.colour = "certeroze", y_secondary.colour_fill = "certeroze6", y_secondary.scientific = NULL, y_secondary.percent = FALSE, y_secondary.labels = NULL, category.labels = NULL, category.percent = FALSE, category.breaks = NULL, category.limits = NULL, category.expand = 0, category.midpoint = NULL, category.transform = "identity", category.date_breaks = NULL, category.date_labels = NULL, category.character = NULL, x.sort = NULL, category.sort = FALSE, facet.sort = TRUE, x.complete = NULL, category.complete = NULL, facet.complete = NULL, datalabels = TRUE, datalabels.round = ifelse(y.percent, 2, 1), datalabels.format = "%n", datalabels.colour = "grey25", datalabels.colour_fill = NULL, datalabels.size = (3 * text_factor), datalabels.angle = 0, datalabels.lineheight = 1, decimal.mark = dec_mark(), big.mark = big_mark(), summarise_function = base::sum, stacked = FALSE, stackedpercent = TRUE, horizontal = FALSE, reverse = TRUE, smooth = NULL, smooth.method = NULL, smooth.formula = NULL, smooth.se = TRUE, smooth.level = 0.95, smooth.alpha = 0.25, smooth.linewidth = 0.75, smooth.linetype = 3, smooth.colour = NULL, size = NULL, linetype = 1, linewidth = NULL, binwidth = NULL, width = NULL, jitter_seed = NA, violin_scale = "count", legend.position = NULL, legend.title = NULL, legend.reverse = FALSE, legend.barheight = 6, legend.barwidth = 1.5, legend.nbin = 300, legend.italic = FALSE, sankey.node_width = 0.15, sankey.node_whitespace = 0.03, sankey.alpha = 0.5, sankey.remove_axes = NULL, zoom = FALSE, sep = " / ", print = FALSE, text_factor = 1, font = getOption("plot2.font"), theme = getOption("plot2.theme", "theme_minimal2"), background = getOption("plot2.colour_background", "white"), markdown = TRUE, data = NULL, ... ) ## S3 method for class 'qc_test' plot2( .data, x = x, y = y, category = rule, facet = NULL, type = "point", x.title = "Index", y.title = "Value", category.title = NULL, title = paste0("QC Chart (", attributes(.data)$guideline, ")"), subtitle = NULL, caption = NULL, tag = NULL, title.linelength = 60, title.colour = getOption("plot2.colour_font_primary", "black"), subtitle.linelength = 60, subtitle.colour = getOption("plot2.colour_font_secondary", "grey35"), na.replace = "", na.rm = FALSE, facet.position = "top", facet.fill = NULL, facet.bold = TRUE, facet.italic = FALSE, facet.size = 10, facet.margin = 8, facet.repeat_lbls_x = TRUE, facet.repeat_lbls_y = TRUE, facet.fixed_y = NULL, facet.fixed_x = TRUE, facet.drop = FALSE, facet.nrow = NULL, facet.relative = FALSE, x.date_breaks = NULL, x.date_labels = NULL, x.date_remove_years = NULL, category.focus = NULL, colour = get_colour(c(Observation = "grey75", `Rule 1` = "certeblauw", `Rule 2` = "certegroen", `Rule 3` = "certeroze", `Rule 4` = "certegeel", `Rule 5` = "certelila", `Rule 6` = "certebruin", `Rule 7` = "certeblauw2", `Rule 8` = "certegroen2")), colour_fill = NULL, colour_opacity = 0, x.lbl_angle = 0, x.lbl_align = NULL, x.lbl_italic = FALSE, x.lbl_taxonomy = FALSE, x.remove = FALSE, x.position = "bottom", x.max_items = Inf, x.max_txt = "(rest, x%n)", category.max_items = Inf, category.max_txt = "(rest, x%n)", facet.max_items = Inf, facet.max_txt = "(rest, x%n)", x.breaks = NULL, x.n_breaks = NULL, x.transform = "identity", x.expand = NULL, x.limits = NULL, x.labels = NULL, x.character = NULL, x.drop = FALSE, x.mic = FALSE, x.zoom = TRUE, y.remove = FALSE, y.24h = FALSE, y.age = FALSE, y.scientific = NULL, y.percent = FALSE, y.percent_break = 0.1, y.breaks = NULL, y.n_breaks = NULL, y.limits = NULL, y.labels = NULL, y.expand = NULL, y.transform = "identity", y.position = "left", y.zoom = TRUE, y_secondary = NULL, y_secondary.type = type, y_secondary.title = TRUE, y_secondary.colour = "certeroze", y_secondary.colour_fill = "certeroze6", y_secondary.scientific = NULL, y_secondary.percent = FALSE, y_secondary.labels = NULL, category.labels = NULL, category.percent = FALSE, category.breaks = NULL, category.limits = NULL, category.expand = 0, category.midpoint = NULL, category.transform = "identity", category.date_breaks = NULL, category.date_labels = NULL, category.character = NULL, x.sort = NULL, category.sort = TRUE, facet.sort = TRUE, x.complete = NULL, category.complete = NULL, facet.complete = NULL, datalabels = TRUE, datalabels.round = ifelse(y.percent, 2, 1), datalabels.format = "%n", datalabels.colour = "grey25", datalabels.colour_fill = NULL, datalabels.size = (3 * text_factor), datalabels.angle = 0, datalabels.lineheight = 1, decimal.mark = dec_mark(), big.mark = big_mark(), summarise_function = base::sum, stacked = FALSE, stackedpercent = FALSE, horizontal = FALSE, reverse = horizontal, smooth = NULL, smooth.method = NULL, smooth.formula = NULL, smooth.se = TRUE, smooth.level = 0.95, smooth.alpha = 0.25, smooth.linewidth = 0.75, smooth.linetype = 3, smooth.colour = NULL, size = 2, linetype = 1, linewidth = NULL, binwidth = NULL, width = NULL, jitter_seed = NA, violin_scale = "count", legend.position = "right", legend.title = NULL, legend.reverse = FALSE, legend.barheight = 6, legend.barwidth = 1.5, legend.nbin = 300, legend.italic = FALSE, sankey.node_width = 0.15, sankey.node_whitespace = 0.03, sankey.alpha = 0.5, sankey.remove_axes = NULL, zoom = TRUE, sep = " / ", print = FALSE, text_factor = 1, font = getOption("plot2.font"), theme = getOption("plot2.theme", "theme_minimal2"), background = getOption("plot2.colour_background", "white"), markdown = TRUE, data = NULL, ... ) ## S3 method for class 'early_warning_cluster' plot2( .data, x = NULL, y = NULL, category = NULL, facet = NULL, type = "line", x.title = ifelse(attributes(.data)$period_length_months == 12, "Maand in periode", "Week in periode"), y.title = paste0("Cases (", attributes(.data)$moving_average_days, "-daags zwevend gemiddelde)"), category.title = "Periode", title = paste0(n_distinct(.data$clusters$cluster), " cluster", ifelse(n_distinct(.data$clusters$cluster) != 1, "s", "")), subtitle = NULL, caption = paste0("O.b.v. uitbijter-vrije geschiedenis (coeff = ", format2(attributes(.data)$remove_outliers_coefficient), ") met pct = ", format2(attributes(.data)$threshold_percentile)), tag = NULL, title.linelength = 60, title.colour = getOption("plot2.colour_font_primary", "black"), subtitle.linelength = 60, subtitle.colour = getOption("plot2.colour_font_secondary", "grey35"), na.replace = "", na.rm = FALSE, facet.position = "top", facet.fill = NULL, facet.bold = TRUE, facet.italic = FALSE, facet.size = 10, facet.margin = 8, facet.repeat_lbls_x = TRUE, facet.repeat_lbls_y = TRUE, facet.fixed_y = NULL, facet.fixed_x = TRUE, facet.drop = FALSE, facet.nrow = NULL, facet.relative = FALSE, x.date_breaks = "1 month", x.date_labels = "mmm", x.date_remove_years = FALSE, category.focus = NULL, colour = getOption("plot2.colour", "ggplot2"), colour_fill = NULL, colour_opacity = 0, x.lbl_angle = 0, x.lbl_align = NULL, x.lbl_italic = FALSE, x.lbl_taxonomy = FALSE, x.remove = FALSE, x.position = "bottom", x.max_items = Inf, x.max_txt = "(rest, x%n)", category.max_items = Inf, category.max_txt = "(rest, x%n)", facet.max_items = Inf, facet.max_txt = "(rest, x%n)", x.breaks = seq(0, 9999, 14), x.n_breaks = NULL, x.transform = "identity", x.expand = NULL, x.limits = NULL, x.labels = function(x) x/7, x.character = NULL, x.drop = FALSE, x.mic = FALSE, x.zoom = FALSE, y.remove = FALSE, y.24h = FALSE, y.age = FALSE, y.scientific = NULL, y.percent = FALSE, y.percent_break = 0.1, y.breaks = NULL, y.n_breaks = NULL, y.limits = NULL, y.labels = NULL, y.expand = NULL, y.transform = "identity", y.position = "left", y.zoom = FALSE, y_secondary = NULL, y_secondary.type = type, y_secondary.title = TRUE, y_secondary.colour = "certeroze", y_secondary.colour_fill = "certeroze6", y_secondary.scientific = NULL, y_secondary.percent = FALSE, y_secondary.labels = NULL, category.labels = md_to_expression, category.percent = FALSE, category.breaks = NULL, category.limits = NULL, category.expand = 0, category.midpoint = NULL, category.transform = "identity", category.date_breaks = NULL, category.date_labels = NULL, category.character = TRUE, x.sort = NULL, category.sort = "asc", facet.sort = TRUE, x.complete = NULL, category.complete = NULL, facet.complete = NULL, datalabels = TRUE, datalabels.round = ifelse(y.percent, 2, 1), datalabels.format = "%n", datalabels.colour = "grey25", datalabels.colour_fill = NULL, datalabels.size = (2.5 * text_factor), datalabels.angle = 0, datalabels.lineheight = 1, decimal.mark = dec_mark(), big.mark = big_mark(), summarise_function = base::sum, stacked = FALSE, stackedpercent = FALSE, horizontal = FALSE, reverse = horizontal, smooth = NULL, smooth.method = NULL, smooth.formula = NULL, smooth.se = TRUE, smooth.level = 0.95, smooth.alpha = 0.25, smooth.linewidth = 0.75, smooth.linetype = 3, smooth.colour = NULL, size = NULL, linetype = 1, linewidth = NULL, binwidth = NULL, width = NULL, jitter_seed = NA, violin_scale = "count", legend.position = "right", legend.title = NULL, legend.reverse = FALSE, legend.barheight = 6, legend.barwidth = 1.5, legend.nbin = 300, legend.italic = FALSE, sankey.node_width = 0.15, sankey.node_whitespace = 0.03, sankey.alpha = 0.5, sankey.remove_axes = NULL, zoom = FALSE, sep = " / ", print = FALSE, text_factor = 1, font = getOption("plot2.font"), theme = getOption("plot2.theme", "theme_minimal2"), background = getOption("plot2.colour_background", "white"), markdown = TRUE, data = NULL, ... )
## S3 method for class 'bug_drug_combinations' plot2( .data, x = ab, y = value, category = name, facet = mo, type = "column", x.title = FALSE, y.title = FALSE, category.title = NULL, title = NULL, subtitle = NULL, caption = NULL, tag = NULL, title.linelength = 60, title.colour = getOption("plot2.colour_font_primary", "black"), subtitle.linelength = 60, subtitle.colour = getOption("plot2.colour_font_secondary", "grey35"), na.replace = "", na.rm = FALSE, facet.position = "top", facet.fill = NULL, facet.bold = TRUE, facet.italic = FALSE, facet.size = 10, facet.margin = 8, facet.repeat_lbls_x = TRUE, facet.repeat_lbls_y = TRUE, facet.fixed_y = NULL, facet.fixed_x = TRUE, facet.drop = FALSE, facet.nrow = NULL, facet.relative = FALSE, x.date_breaks = NULL, x.date_labels = NULL, x.date_remove_years = NULL, category.focus = NULL, colour = get_colour("certe_sir2", 7), colour_fill = NULL, colour_opacity = 0, x.lbl_angle = ifelse(horizontal, 0, 90), x.lbl_align = NULL, x.lbl_italic = FALSE, x.lbl_taxonomy = TRUE, x.remove = FALSE, x.position = "bottom", x.max_items = Inf, x.max_txt = "(rest, x%n)", category.max_items = Inf, category.max_txt = "(rest, x%n)", facet.max_items = Inf, facet.max_txt = "(rest, x%n)", x.breaks = NULL, x.n_breaks = NULL, x.transform = "identity", x.expand = NULL, x.limits = NULL, x.labels = NULL, x.character = NULL, x.drop = FALSE, x.mic = FALSE, x.zoom = FALSE, y.remove = FALSE, y.24h = FALSE, y.age = FALSE, y.scientific = NULL, y.percent = FALSE, y.percent_break = 0.1, y.breaks = NULL, y.n_breaks = NULL, y.limits = NULL, y.labels = NULL, y.expand = NULL, y.transform = "identity", y.position = "left", y.zoom = FALSE, y_secondary = NULL, y_secondary.type = type, y_secondary.title = TRUE, y_secondary.colour = "certeroze", y_secondary.colour_fill = "certeroze6", y_secondary.scientific = NULL, y_secondary.percent = FALSE, y_secondary.labels = NULL, category.labels = NULL, category.percent = FALSE, category.breaks = NULL, category.limits = NULL, category.expand = 0, category.midpoint = NULL, category.transform = "identity", category.date_breaks = NULL, category.date_labels = NULL, category.character = NULL, x.sort = NULL, category.sort = FALSE, facet.sort = TRUE, x.complete = NULL, category.complete = NULL, facet.complete = NULL, datalabels = TRUE, datalabels.round = ifelse(y.percent, 2, 1), datalabels.format = "%n", datalabels.colour = "grey25", datalabels.colour_fill = NULL, datalabels.size = (3 * text_factor), datalabels.angle = 0, datalabels.lineheight = 1, decimal.mark = dec_mark(), big.mark = big_mark(), summarise_function = base::sum, stacked = FALSE, stackedpercent = TRUE, horizontal = TRUE, reverse = TRUE, smooth = NULL, smooth.method = NULL, smooth.formula = NULL, smooth.se = TRUE, smooth.level = 0.95, smooth.alpha = 0.25, smooth.linewidth = 0.75, smooth.linetype = 3, smooth.colour = NULL, size = NULL, linetype = 1, linewidth = NULL, binwidth = NULL, width = NULL, jitter_seed = NA, violin_scale = "count", legend.position = NULL, legend.title = NULL, legend.reverse = TRUE, legend.barheight = 6, legend.barwidth = 1.5, legend.nbin = 300, legend.italic = FALSE, sankey.node_width = 0.15, sankey.node_whitespace = 0.03, sankey.alpha = 0.5, sankey.remove_axes = NULL, zoom = FALSE, sep = " / ", print = FALSE, text_factor = 1, font = getOption("plot2.font"), theme = getOption("plot2.theme", "theme_minimal2"), background = getOption("plot2.colour_background", "white"), markdown = TRUE, data = NULL, minimum = 30, remove_intrinsic_resistant = TRUE, language = "nl", ... ) ## S3 method for class 'antibiogram' plot2( .data, x = NULL, y = NULL, category = NULL, facet = NULL, type = NULL, x.title = NULL, y.title = NULL, category.title = NULL, title = NULL, subtitle = NULL, caption = NULL, tag = NULL, title.linelength = 60, title.colour = getOption("plot2.colour_font_primary", "black"), subtitle.linelength = 60, subtitle.colour = getOption("plot2.colour_font_secondary", "grey35"), na.replace = "", na.rm = FALSE, facet.position = "top", facet.fill = NULL, facet.bold = TRUE, facet.italic = FALSE, facet.size = 10, facet.margin = 8, facet.repeat_lbls_x = TRUE, facet.repeat_lbls_y = TRUE, facet.fixed_y = NULL, facet.fixed_x = TRUE, facet.drop = FALSE, facet.nrow = NULL, facet.relative = FALSE, x.date_breaks = NULL, x.date_labels = NULL, x.date_remove_years = NULL, category.focus = NULL, colour = getOption("plot2.colour", "ggplot2"), colour_fill = NULL, colour_opacity = 0, x.lbl_angle = 0, x.lbl_align = NULL, x.lbl_italic = FALSE, x.lbl_taxonomy = FALSE, x.remove = FALSE, x.position = "bottom", x.max_items = Inf, x.max_txt = "(rest, x%n)", category.max_items = Inf, category.max_txt = "(rest, x%n)", facet.max_items = Inf, facet.max_txt = "(rest, x%n)", x.breaks = NULL, x.n_breaks = NULL, x.transform = "identity", x.expand = NULL, x.limits = NULL, x.labels = NULL, x.character = NULL, x.drop = FALSE, x.mic = FALSE, x.zoom = FALSE, y.remove = FALSE, y.24h = FALSE, y.age = FALSE, y.scientific = NULL, y.percent = FALSE, y.percent_break = 0.1, y.breaks = NULL, y.n_breaks = NULL, y.limits = NULL, y.labels = NULL, y.expand = NULL, y.transform = "identity", y.position = "left", y.zoom = FALSE, y_secondary = NULL, y_secondary.type = type, y_secondary.title = TRUE, y_secondary.colour = "certeroze", y_secondary.colour_fill = "certeroze6", y_secondary.scientific = NULL, y_secondary.percent = FALSE, y_secondary.labels = NULL, category.labels = NULL, category.percent = FALSE, category.breaks = NULL, category.limits = NULL, category.expand = 0, category.midpoint = NULL, category.transform = "identity", category.date_breaks = NULL, category.date_labels = NULL, category.character = NULL, x.sort = NULL, category.sort = TRUE, facet.sort = TRUE, x.complete = NULL, category.complete = NULL, facet.complete = NULL, datalabels = TRUE, datalabels.round = ifelse(y.percent, 2, 1), datalabels.format = "%n", datalabels.colour = "grey25", datalabels.colour_fill = NULL, datalabels.size = (3 * text_factor), datalabels.angle = 0, datalabels.lineheight = 1, decimal.mark = dec_mark(), big.mark = big_mark(), summarise_function = base::sum, stacked = FALSE, stackedpercent = FALSE, horizontal = FALSE, reverse = horizontal, smooth = NULL, smooth.method = NULL, smooth.formula = NULL, smooth.se = TRUE, smooth.level = 0.95, smooth.alpha = 0.25, smooth.linewidth = 0.75, smooth.linetype = 3, smooth.colour = NULL, size = NULL, linetype = 1, linewidth = NULL, binwidth = NULL, width = NULL, jitter_seed = NA, violin_scale = "count", legend.position = NULL, legend.title = NULL, legend.reverse = FALSE, legend.barheight = 6, legend.barwidth = 1.5, legend.nbin = 300, legend.italic = FALSE, sankey.node_width = 0.15, sankey.node_whitespace = 0.03, sankey.alpha = 0.5, sankey.remove_axes = NULL, zoom = FALSE, sep = " / ", print = FALSE, text_factor = 1, font = getOption("plot2.font"), theme = getOption("plot2.theme", "theme_minimal2"), background = getOption("plot2.colour_background", "white"), markdown = TRUE, data = NULL, ... ) ## S3 method for class 'sir_df' plot2( .data, x = NULL, y = isolates, category = interpretation, facet = antibiotic, type = "column", x.title = TRUE, y.title = FALSE, category.title = NULL, title = FALSE, subtitle = NULL, caption = NULL, tag = NULL, title.linelength = 60, title.colour = getOption("plot2.colour_font_primary", "black"), subtitle.linelength = 60, subtitle.colour = getOption("plot2.colour_font_secondary", "grey35"), na.replace = "", na.rm = FALSE, facet.position = "top", facet.fill = NULL, facet.bold = TRUE, facet.italic = FALSE, facet.size = 10, facet.margin = 8, facet.repeat_lbls_x = TRUE, facet.repeat_lbls_y = TRUE, facet.fixed_y = NULL, facet.fixed_x = TRUE, facet.drop = FALSE, facet.nrow = NULL, facet.relative = FALSE, x.date_breaks = NULL, x.date_labels = NULL, x.date_remove_years = NULL, category.focus = NULL, colour = get_colour("certe_sir2", 5), colour_fill = NULL, colour_opacity = 0, x.lbl_angle = 0, x.lbl_align = NULL, x.lbl_italic = FALSE, x.lbl_taxonomy = TRUE, x.remove = FALSE, x.position = "bottom", x.max_items = Inf, x.max_txt = "(rest, x%n)", category.max_items = Inf, category.max_txt = "(rest, x%n)", facet.max_items = Inf, facet.max_txt = "(rest, x%n)", x.breaks = NULL, x.n_breaks = NULL, x.transform = "identity", x.expand = NULL, x.limits = NULL, x.labels = NULL, x.character = NULL, x.drop = FALSE, x.mic = FALSE, x.zoom = FALSE, y.remove = FALSE, y.24h = FALSE, y.age = FALSE, y.scientific = NULL, y.percent = FALSE, y.percent_break = 0.1, y.breaks = NULL, y.n_breaks = NULL, y.limits = NULL, y.labels = NULL, y.expand = NULL, y.transform = "identity", y.position = "left", y.zoom = FALSE, y_secondary = NULL, y_secondary.type = type, y_secondary.title = TRUE, y_secondary.colour = "certeroze", y_secondary.colour_fill = "certeroze6", y_secondary.scientific = NULL, y_secondary.percent = FALSE, y_secondary.labels = NULL, category.labels = NULL, category.percent = FALSE, category.breaks = NULL, category.limits = NULL, category.expand = 0, category.midpoint = NULL, category.transform = "identity", category.date_breaks = NULL, category.date_labels = NULL, category.character = NULL, x.sort = NULL, category.sort = FALSE, facet.sort = TRUE, x.complete = NULL, category.complete = NULL, facet.complete = NULL, datalabels = TRUE, datalabels.round = ifelse(y.percent, 2, 1), datalabels.format = "%n", datalabels.colour = "grey25", datalabels.colour_fill = NULL, datalabels.size = (3 * text_factor), datalabels.angle = 0, datalabels.lineheight = 1, decimal.mark = dec_mark(), big.mark = big_mark(), summarise_function = base::sum, stacked = FALSE, stackedpercent = TRUE, horizontal = FALSE, reverse = TRUE, smooth = NULL, smooth.method = NULL, smooth.formula = NULL, smooth.se = TRUE, smooth.level = 0.95, smooth.alpha = 0.25, smooth.linewidth = 0.75, smooth.linetype = 3, smooth.colour = NULL, size = NULL, linetype = 1, linewidth = NULL, binwidth = NULL, width = NULL, jitter_seed = NA, violin_scale = "count", legend.position = NULL, legend.title = NULL, legend.reverse = FALSE, legend.barheight = 6, legend.barwidth = 1.5, legend.nbin = 300, legend.italic = FALSE, sankey.node_width = 0.15, sankey.node_whitespace = 0.03, sankey.alpha = 0.5, sankey.remove_axes = NULL, zoom = FALSE, sep = " / ", print = FALSE, text_factor = 1, font = getOption("plot2.font"), theme = getOption("plot2.theme", "theme_minimal2"), background = getOption("plot2.colour_background", "white"), markdown = TRUE, data = NULL, ... ) ## S3 method for class 'qc_test' plot2( .data, x = x, y = y, category = rule, facet = NULL, type = "point", x.title = "Index", y.title = "Value", category.title = NULL, title = paste0("QC Chart (", attributes(.data)$guideline, ")"), subtitle = NULL, caption = NULL, tag = NULL, title.linelength = 60, title.colour = getOption("plot2.colour_font_primary", "black"), subtitle.linelength = 60, subtitle.colour = getOption("plot2.colour_font_secondary", "grey35"), na.replace = "", na.rm = FALSE, facet.position = "top", facet.fill = NULL, facet.bold = TRUE, facet.italic = FALSE, facet.size = 10, facet.margin = 8, facet.repeat_lbls_x = TRUE, facet.repeat_lbls_y = TRUE, facet.fixed_y = NULL, facet.fixed_x = TRUE, facet.drop = FALSE, facet.nrow = NULL, facet.relative = FALSE, x.date_breaks = NULL, x.date_labels = NULL, x.date_remove_years = NULL, category.focus = NULL, colour = get_colour(c(Observation = "grey75", `Rule 1` = "certeblauw", `Rule 2` = "certegroen", `Rule 3` = "certeroze", `Rule 4` = "certegeel", `Rule 5` = "certelila", `Rule 6` = "certebruin", `Rule 7` = "certeblauw2", `Rule 8` = "certegroen2")), colour_fill = NULL, colour_opacity = 0, x.lbl_angle = 0, x.lbl_align = NULL, x.lbl_italic = FALSE, x.lbl_taxonomy = FALSE, x.remove = FALSE, x.position = "bottom", x.max_items = Inf, x.max_txt = "(rest, x%n)", category.max_items = Inf, category.max_txt = "(rest, x%n)", facet.max_items = Inf, facet.max_txt = "(rest, x%n)", x.breaks = NULL, x.n_breaks = NULL, x.transform = "identity", x.expand = NULL, x.limits = NULL, x.labels = NULL, x.character = NULL, x.drop = FALSE, x.mic = FALSE, x.zoom = TRUE, y.remove = FALSE, y.24h = FALSE, y.age = FALSE, y.scientific = NULL, y.percent = FALSE, y.percent_break = 0.1, y.breaks = NULL, y.n_breaks = NULL, y.limits = NULL, y.labels = NULL, y.expand = NULL, y.transform = "identity", y.position = "left", y.zoom = TRUE, y_secondary = NULL, y_secondary.type = type, y_secondary.title = TRUE, y_secondary.colour = "certeroze", y_secondary.colour_fill = "certeroze6", y_secondary.scientific = NULL, y_secondary.percent = FALSE, y_secondary.labels = NULL, category.labels = NULL, category.percent = FALSE, category.breaks = NULL, category.limits = NULL, category.expand = 0, category.midpoint = NULL, category.transform = "identity", category.date_breaks = NULL, category.date_labels = NULL, category.character = NULL, x.sort = NULL, category.sort = TRUE, facet.sort = TRUE, x.complete = NULL, category.complete = NULL, facet.complete = NULL, datalabels = TRUE, datalabels.round = ifelse(y.percent, 2, 1), datalabels.format = "%n", datalabels.colour = "grey25", datalabels.colour_fill = NULL, datalabels.size = (3 * text_factor), datalabels.angle = 0, datalabels.lineheight = 1, decimal.mark = dec_mark(), big.mark = big_mark(), summarise_function = base::sum, stacked = FALSE, stackedpercent = FALSE, horizontal = FALSE, reverse = horizontal, smooth = NULL, smooth.method = NULL, smooth.formula = NULL, smooth.se = TRUE, smooth.level = 0.95, smooth.alpha = 0.25, smooth.linewidth = 0.75, smooth.linetype = 3, smooth.colour = NULL, size = 2, linetype = 1, linewidth = NULL, binwidth = NULL, width = NULL, jitter_seed = NA, violin_scale = "count", legend.position = "right", legend.title = NULL, legend.reverse = FALSE, legend.barheight = 6, legend.barwidth = 1.5, legend.nbin = 300, legend.italic = FALSE, sankey.node_width = 0.15, sankey.node_whitespace = 0.03, sankey.alpha = 0.5, sankey.remove_axes = NULL, zoom = TRUE, sep = " / ", print = FALSE, text_factor = 1, font = getOption("plot2.font"), theme = getOption("plot2.theme", "theme_minimal2"), background = getOption("plot2.colour_background", "white"), markdown = TRUE, data = NULL, ... ) ## S3 method for class 'early_warning_cluster' plot2( .data, x = NULL, y = NULL, category = NULL, facet = NULL, type = "line", x.title = ifelse(attributes(.data)$period_length_months == 12, "Maand in periode", "Week in periode"), y.title = paste0("Cases (", attributes(.data)$moving_average_days, "-daags zwevend gemiddelde)"), category.title = "Periode", title = paste0(n_distinct(.data$clusters$cluster), " cluster", ifelse(n_distinct(.data$clusters$cluster) != 1, "s", "")), subtitle = NULL, caption = paste0("O.b.v. uitbijter-vrije geschiedenis (coeff = ", format2(attributes(.data)$remove_outliers_coefficient), ") met pct = ", format2(attributes(.data)$threshold_percentile)), tag = NULL, title.linelength = 60, title.colour = getOption("plot2.colour_font_primary", "black"), subtitle.linelength = 60, subtitle.colour = getOption("plot2.colour_font_secondary", "grey35"), na.replace = "", na.rm = FALSE, facet.position = "top", facet.fill = NULL, facet.bold = TRUE, facet.italic = FALSE, facet.size = 10, facet.margin = 8, facet.repeat_lbls_x = TRUE, facet.repeat_lbls_y = TRUE, facet.fixed_y = NULL, facet.fixed_x = TRUE, facet.drop = FALSE, facet.nrow = NULL, facet.relative = FALSE, x.date_breaks = "1 month", x.date_labels = "mmm", x.date_remove_years = FALSE, category.focus = NULL, colour = getOption("plot2.colour", "ggplot2"), colour_fill = NULL, colour_opacity = 0, x.lbl_angle = 0, x.lbl_align = NULL, x.lbl_italic = FALSE, x.lbl_taxonomy = FALSE, x.remove = FALSE, x.position = "bottom", x.max_items = Inf, x.max_txt = "(rest, x%n)", category.max_items = Inf, category.max_txt = "(rest, x%n)", facet.max_items = Inf, facet.max_txt = "(rest, x%n)", x.breaks = seq(0, 9999, 14), x.n_breaks = NULL, x.transform = "identity", x.expand = NULL, x.limits = NULL, x.labels = function(x) x/7, x.character = NULL, x.drop = FALSE, x.mic = FALSE, x.zoom = FALSE, y.remove = FALSE, y.24h = FALSE, y.age = FALSE, y.scientific = NULL, y.percent = FALSE, y.percent_break = 0.1, y.breaks = NULL, y.n_breaks = NULL, y.limits = NULL, y.labels = NULL, y.expand = NULL, y.transform = "identity", y.position = "left", y.zoom = FALSE, y_secondary = NULL, y_secondary.type = type, y_secondary.title = TRUE, y_secondary.colour = "certeroze", y_secondary.colour_fill = "certeroze6", y_secondary.scientific = NULL, y_secondary.percent = FALSE, y_secondary.labels = NULL, category.labels = md_to_expression, category.percent = FALSE, category.breaks = NULL, category.limits = NULL, category.expand = 0, category.midpoint = NULL, category.transform = "identity", category.date_breaks = NULL, category.date_labels = NULL, category.character = TRUE, x.sort = NULL, category.sort = "asc", facet.sort = TRUE, x.complete = NULL, category.complete = NULL, facet.complete = NULL, datalabels = TRUE, datalabels.round = ifelse(y.percent, 2, 1), datalabels.format = "%n", datalabels.colour = "grey25", datalabels.colour_fill = NULL, datalabels.size = (2.5 * text_factor), datalabels.angle = 0, datalabels.lineheight = 1, decimal.mark = dec_mark(), big.mark = big_mark(), summarise_function = base::sum, stacked = FALSE, stackedpercent = FALSE, horizontal = FALSE, reverse = horizontal, smooth = NULL, smooth.method = NULL, smooth.formula = NULL, smooth.se = TRUE, smooth.level = 0.95, smooth.alpha = 0.25, smooth.linewidth = 0.75, smooth.linetype = 3, smooth.colour = NULL, size = NULL, linetype = 1, linewidth = NULL, binwidth = NULL, width = NULL, jitter_seed = NA, violin_scale = "count", legend.position = "right", legend.title = NULL, legend.reverse = FALSE, legend.barheight = 6, legend.barwidth = 1.5, legend.nbin = 300, legend.italic = FALSE, sankey.node_width = 0.15, sankey.node_whitespace = 0.03, sankey.alpha = 0.5, sankey.remove_axes = NULL, zoom = FALSE, sep = " / ", print = FALSE, text_factor = 1, font = getOption("plot2.font"), theme = getOption("plot2.theme", "theme_minimal2"), background = getOption("plot2.colour_background", "white"), markdown = TRUE, data = NULL, ... )
.data , data
|
data to plot |
x |
plotting 'direction' for the x axis. This can be:
|
y |
values to use for plotting along the y axis. This can be:
|
category , facet
|
plotting 'direction' (
The |
type , y_secondary.type
|
type of visualisation to use. This can be:
|
title , subtitle , caption , tag , x.title , y.title , category.title , legend.title , y_secondary.title
|
a title to use. This can be:
The |
title.linelength |
maximum number of characters per line in the title, before a linebreak occurs |
title.colour |
text colour of the title |
subtitle.linelength |
maximum number of characters per line in the subtitle, before a linebreak occurs |
subtitle.colour |
text colour of the subtitle |
na.replace |
character to put in place of |
na.rm |
remove |
facet.position , facet.fill , facet.bold , facet.italic , facet.size , facet.margin , facet.repeat_lbls_x , facet.repeat_lbls_y , facet.drop , facet.nrow , facet.relative
|
additional settings for the plotting direction |
facet.fixed_y |
a logical to indicate whether all y scales should have the same limits. Defaults to |
facet.fixed_x |
a logical to indicate whether all x scales should have the same breaks. This acts like the inverse of |
x.date_breaks |
breaks to use when the x axis contains dates, will be determined automatically if left blank. This accepts values such as |
x.date_labels |
labels to use when the x axis contains dates, will be determined automatically if left blank. This accepts 'Excel' date-language such as |
x.date_remove_years |
a logical to indicate whether the years of all |
category.focus |
a value of |
colour |
get_colour(s) to set, will be evaluated with |
colour_fill |
get_colour(s) to be used for filling, will be determined automatically if left blank and will be evaluated with |
colour_opacity |
amount of opacity for |
x.lbl_angle |
angle to use for the x axis in a counter-clockwise direction (i.e., a value of |
x.lbl_align |
alignment for the x axis between |
x.lbl_italic |
logical to indicate whether the x labels should in in italics |
x.lbl_taxonomy |
a logical to transform all words of the |
x.remove , y.remove
|
a logical to indicate whether the axis labels and title should be removed |
x.position , y.position
|
position of the axis |
x.max_items , category.max_items , facet.max_items
|
number of maximum items to use, defaults to infinite. All other values will be grouped and summarised using the |
x.max_txt , category.max_txt , facet.max_txt
|
the text to use of values not included number of |
x.breaks , y.breaks
|
a breaks function or numeric vector to use for the axis |
x.n_breaks , y.n_breaks
|
number of breaks, only useful if |
x.transform , y.transform , category.transform
|
a transformation function to use, e.g. |
x.expand , y.expand
|
expansion to use for the axis, can be length 1 or 2. |
x.limits , y.limits
|
limits to use for the axis, can be length 1 or 2. Use |
x.labels , y.labels , y_secondary.labels
|
a labels function or character vector to use for the axis |
x.character |
a logical to indicate whether the values of the x axis should be forced to character. The default is |
x.drop |
logical to indicate whether factor levels should be dropped |
x.mic |
logical to indicate whether the x axis should be formatted as MIC values, by dropping all factor levels and adding missing factors of 2 |
x.zoom , y.zoom
|
a logical to indicate if the axis should be zoomed on the data, by setting |
y.24h |
a logical to indicate whether the y labels and breaks should be formatted as 24-hour sequences |
y.age |
a logical to indicate whether the y labels and breaks should be formatted as ages in years |
y.scientific , y_secondary.scientific
|
a logical to indicate whether the y labels should be formatted in scientific notation. Defaults to |
y.percent , y_secondary.percent
|
a logical to indicate whether the y labels should be formatted as percentages |
y.percent_break |
a value on which the y axis should have breaks |
y_secondary |
values to use for plotting along the secondary y axis. This functionality is poorly supported by |
y_secondary.colour , y_secondary.colour_fill
|
colours to set for the secondary y axis, will be evaluated with |
category.labels , category.percent , category.breaks , category.expand , category.midpoint
|
settings for the plotting direction |
category.limits |
limits to use for a numeric category, can be length 1 or 2. Use |
category.date_breaks |
breaks to use when the category contains dates, will be determined automatically if left blank. This will be passed on to |
category.date_labels |
labels to use when the category contains dates, will be determined automatically if left blank. This accepts 'Excel' date-language such as |
category.character |
a logical to indicate whether the values of the category should be forced to character. The default is |
x.sort , category.sort , facet.sort
|
sorting of the plotting direction, defaults to
|
x.complete , category.complete , facet.complete
|
a value to complete the data. This makes use of |
datalabels |
values to show as datalabels, see also
|
datalabels.round |
number of digits to round the datalabels, applies to both |
datalabels.format |
format to use for datalabels. This can be a function (such as |
datalabels.colour , datalabels.colour_fill , datalabels.size , datalabels.angle , datalabels.lineheight
|
settings for the datalabels |
decimal.mark |
decimal mark, defaults to |
big.mark |
thousands separator, defaults to |
summarise_function |
a function to use if the data has to be summarised, see Examples. This can also be |
stacked |
a logical to indicate that values must be stacked |
stackedpercent |
a logical to indicate that values must be 100% stacked |
horizontal |
a logical to turn the plot 90 degrees using |
reverse |
a logical to reverse the values of |
smooth |
a logical to add a smooth. In histograms, this will add the density count as an overlaying line (default: |
smooth.method , smooth.formula , smooth.se , smooth.level , smooth.alpha , smooth.linewidth , smooth.linetype , smooth.colour
|
settings for |
size |
size of the geom. Defaults to |
linetype |
linetype of the geom, only suitable for geoms that draw lines. Defaults to 1. |
linewidth |
linewidth of the geom, only suitable for geoms that draw lines. Defaults to: |
binwidth |
width of bins (only useful for |
width |
width of the geom. Defaults to |
jitter_seed |
seed (randomisation factor) to be set when using |
violin_scale |
scale to be set when using |
legend.position |
position of the legend, must be |
legend.reverse , legend.barheight , legend.barwidth , legend.nbin , legend.italic
|
other settings for the legend |
sankey.node_width |
width of the vertical nodes in a Sankey plot (i.e., when |
sankey.node_whitespace |
whitespace between the nodes |
sankey.alpha |
alpha of the flows in a Sankey plot (i.e., when |
sankey.remove_axes |
logical to indicate whether all axes must be removed in a Sankey plot (i.e., when |
zoom |
a logical to indicate if the plot should be scaled to the data, i.e., not having the x and y axes to start at 0. This will set |
sep |
separator character to use if multiple columns are given to either of the three directions: |
print |
a logical to indicate if the result should be printed instead of just returned |
text_factor |
text factor to use, which will apply to all texts shown in the plot |
font |
font (family) to use, can be set with |
theme |
a valid |
background |
the background colour of the entire plot, can also be |
markdown |
a logical to turn all labels and titles into plotmath expressions, by converting common markdown language using the |
minimum |
minimum number of results, defaults to |
remove_intrinsic_resistant |
a logical to indicate that rows with 100% resistance must be removed from the data set before plotting |
language |
language to be used for antibiotic names |
... |
any argument to give to the geom. This will override automatically-set settings for the geom. |
For antimicrobial resistance (AMR) data analysis, use the bug_drug_combinations()
or the sir_df()
function from the AMR
package on a data set with antibiograms. The result can be used as input for plot2()
.
The QC-test can be acquired with certestats::qc_test()
. It applies the Nelson QC rules for a vector of values.
The detection of disease clusters can be done using certestats::early_warning_cluster()
. Use size
to alter the size of the triangles that indicate clusters.
# AMR DATA ANALYSIS ---------------------------------------------------- if (require("AMR")) { example_isolates[, c("mo", "AMX", "AMC", "ward")] |> antibiogram(mo_transform = "gramstain", language = "nl") |> plot2() } if (require("AMR")) { example_isolates[, c("mo", "AMX", "AMC", "ward")] |> antibiogram(mo_transform = "gramstain", language = "nl", syndromic_group = "ward") |> plot2() } # DISEASE CLUSTERS ----------------------------------------------------- cases <- data.frame(date = sample(seq(as.Date("2015-01-01"), as.Date("2022-12-31"), "1 day"), size = 300), patient = sample(LETTERS, size = 300, replace = TRUE)) check <- certestats::early_warning_cluster(cases, minimum_cases = 1, threshold_percentile = 0.75) check |> plot2()
# AMR DATA ANALYSIS ---------------------------------------------------- if (require("AMR")) { example_isolates[, c("mo", "AMX", "AMC", "ward")] |> antibiogram(mo_transform = "gramstain", language = "nl") |> plot2() } if (require("AMR")) { example_isolates[, c("mo", "AMX", "AMC", "ward")] |> antibiogram(mo_transform = "gramstain", language = "nl", syndromic_group = "ward") |> plot2() } # DISEASE CLUSTERS ----------------------------------------------------- cases <- data.frame(date = sample(seq(as.Date("2015-01-01"), as.Date("2022-12-31"), "1 day"), size = 300), patient = sample(LETTERS, size = 300, replace = TRUE)) check <- certestats::early_warning_cluster(cases, minimum_cases = 1, threshold_percentile = 0.75) check |> plot2()
These scales apply the colours of Certe, using the 'certestyle' package.
scale_colour_certe_c( ..., values = NULL, space = "Lab", na.value = "grey50", guide = "colourbar", aesthetics = "colour" ) scale_color_certe_c( ..., values = NULL, space = "Lab", na.value = "grey50", guide = "colourbar", aesthetics = "colour" ) scale_fill_certe_c( ..., values = NULL, space = "Lab", na.value = "grey50", guide = "colourbar", aesthetics = "fill" ) scale_colour_certe_d(colour = "certe") scale_color_certe_d(colour = "certe") scale_fill_certe_d(colour = "certe")
scale_colour_certe_c( ..., values = NULL, space = "Lab", na.value = "grey50", guide = "colourbar", aesthetics = "colour" ) scale_color_certe_c( ..., values = NULL, space = "Lab", na.value = "grey50", guide = "colourbar", aesthetics = "colour" ) scale_fill_certe_c( ..., values = NULL, space = "Lab", na.value = "grey50", guide = "colourbar", aesthetics = "fill" ) scale_colour_certe_d(colour = "certe") scale_color_certe_d(colour = "certe") scale_fill_certe_d(colour = "certe")
... |
Arguments passed on to
|
values |
if colours should not be evenly positioned along the gradient
this vector gives the position (between 0 and 1) for each colour in the
|
space |
colour space in which to calculate gradient. Must be "Lab" - other values are deprecated. |
na.value |
Colour to use for missing values |
guide |
Type of legend. Use |
aesthetics |
Character string or vector of character strings listing the
name(s) of the aesthetic(s) that this scale works with. This can be useful, for
example, to apply colour settings to the |
colour |
a Certe colour set: |