1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-08 08:32:04 +02:00

(v0.6.1.9043) age doc fix

This commit is contained in:
2019-05-30 08:51:38 +02:00
parent 8b5e2b030b
commit 1f8ee3ec3e
14 changed files with 50 additions and 51 deletions

View File

@ -107,7 +107,7 @@ age <- function(x, reference = Sys.Date()) {
#' # resistance of ciprofloxacine per age group
#' library(dplyr)
#' septic_patients %>%
#' filter_first_isolate) %>%
#' filter_first_isolate() %>%
#' filter(mo == as.mo("E. coli")) %>%
#' group_by(age_group = age_groups(age)) %>%
#' select(age_group, CIP) %>%

View File

@ -162,9 +162,9 @@ ggplot_rsi <- function(data,
language = get_locale(),
fun = count_df,
nrow = NULL,
datalabels = TRUE,
datalabels = FALSE,
datalabels.size = 3,
datalabels.colour = "grey15",
datalabels.colour = "white",
...) {
stopifnot_installed_package("ggplot2")
@ -209,7 +209,7 @@ ggplot_rsi <- function(data,
position <- "fill"
}
if (fun_name == "portion_df"
| (fun_name == "count_df" & position == "fill")) {
| (fun_name == "count_df" & identical(position, "fill"))) {
# portions, so use y scale with percentage
p <- p + scale_y_percent(breaks = breaks, limits = limits)
}
@ -361,13 +361,13 @@ theme_rsi <- function() {
labels_rsi_count <- function(position = NULL,
x = "Antibiotic",
datalabels.size = 3,
datalabels.colour = "grey15") {
datalabels.colour = "white") {
stopifnot_installed_package("ggplot2")
if (is.null(position)) {
position <- "fill"
}
if (position == "fill") {
position <- ggplot2::position_fill(vjust = 0.5)
if (identical(position, "fill")) {
position <- ggplot2::position_fill(vjust = 0.5, reverse = TRUE)
}
ggplot2::geom_text(mapping = ggplot2::aes_string(label = "lbl",
x = x,