From 1f8ee3ec3e0852020939e4ff19b133fbbfdcfa33 Mon Sep 17 00:00:00 2001 From: "Matthijs S. Berends" Date: Thu, 30 May 2019 08:51:38 +0200 Subject: [PATCH] (v0.6.1.9043) age doc fix --- DESCRIPTION | 4 +-- R/age.R | 2 +- R/ggplot_rsi.R | 12 ++++---- docs/LICENSE-text.html | 2 +- docs/articles/index.html | 2 +- docs/authors.html | 2 +- docs/index.html | 2 +- docs/news/index.html | 2 +- docs/reference/age_groups.html | 53 +++++++++++++++++----------------- docs/reference/ggplot_rsi.html | 8 ++--- docs/reference/index.html | 2 +- git_premaster.sh | 2 +- man/age_groups.Rd | 2 +- man/ggplot_rsi.Rd | 6 ++-- 14 files changed, 50 insertions(+), 51 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index c0d32763..4aef11f4 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: AMR -Version: 0.6.1.9042 -Date: 2019-05-29 +Version: 0.6.1.9043 +Date: 2019-05-30 Title: Antimicrobial Resistance Analysis Authors@R: c( person( diff --git a/R/age.R b/R/age.R index 26dbaa2a..bb9d4c10 100755 --- a/R/age.R +++ b/R/age.R @@ -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) %>% diff --git a/R/ggplot_rsi.R b/R/ggplot_rsi.R index 126cb796..d312a4db 100755 --- a/R/ggplot_rsi.R +++ b/R/ggplot_rsi.R @@ -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, diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index fde2caf9..9f20e05a 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -78,7 +78,7 @@ AMR (for R) - 0.6.1.9042 + 0.6.1.9043 diff --git a/docs/articles/index.html b/docs/articles/index.html index 6ff3241f..94f10ec0 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -78,7 +78,7 @@ AMR (for R) - 0.6.1.9042 + 0.6.1.9043 diff --git a/docs/authors.html b/docs/authors.html index 002b35ca..8a1fd759 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -78,7 +78,7 @@ AMR (for R) - 0.6.1.9042 + 0.6.1.9043 diff --git a/docs/index.html b/docs/index.html index 766ee653..e0e6061f 100644 --- a/docs/index.html +++ b/docs/index.html @@ -42,7 +42,7 @@ AMR (for R) - 0.6.1.9042 + 0.6.1.9043 diff --git a/docs/news/index.html b/docs/news/index.html index fd7eb547..75e59ab8 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -78,7 +78,7 @@ AMR (for R) - 0.6.1.9042 + 0.6.1.9043 diff --git a/docs/reference/age_groups.html b/docs/reference/age_groups.html index 5e25dba6..336945a7 100644 --- a/docs/reference/age_groups.html +++ b/docs/reference/age_groups.html @@ -80,7 +80,7 @@ AMR (for R) - 0.6.1.9042 + 0.6.1.9043 @@ -291,38 +291,37 @@

Examples

-
# NOT RUN {
-ages <- c(3, 8, 16, 54, 31, 76, 101, 43, 21)
+    
# NOT RUN {
+ages <- c(3, 8, 16, 54, 31, 76, 101, 43, 21)
 
-# split into 0-49 and 50+
-age_groups(ages, 50)
+# split into 0-49 and 50+
+age_groups(ages, 50)
 
-# split into 0-19, 20-49 and 50+
-age_groups(ages, c(20, 50))
+# split into 0-19, 20-49 and 50+
+age_groups(ages, c(20, 50))
 
-# split into groups of ten years
-age_groups(ages, 1:10 * 10)
-age_groups(ages, split_at = "tens")
+# split into groups of ten years
+age_groups(ages, 1:10 * 10)
+age_groups(ages, split_at = "tens")
 
-# split into groups of five years
-age_groups(ages, 1:20 * 5)
-age_groups(ages, split_at = "fives")
+# split into groups of five years
+age_groups(ages, 1:20 * 5)
+age_groups(ages, split_at = "fives")
 
-# split specifically for children
-age_groups(ages, "children")
-# same:
-age_groups(ages, c(1, 2, 4, 6, 13, 17))
+# split specifically for children
+age_groups(ages, "children")
+# same:
+age_groups(ages, c(1, 2, 4, 6, 13, 17))
 
-# resistance of ciprofloxacine per age group
-library(dplyr)
-septic_patients %>%
-  filter_first_isolate) %>%
-  filter(mo == as.mo("E. coli")) %>%
-  group_by(age_group = age_groups(age)) %>%
-  select(age_group, CIP) %>%
-  ggplot_rsi(x = "age_group")
-# }
-
+# resistance of ciprofloxacine per age group +library(dplyr) +septic_patients %>% + filter_first_isolate() %>% + filter(mo == as.mo("E. coli")) %>% + group_by(age_group = age_groups(age)) %>% + select(age_group, CIP) %>% + ggplot_rsi(x = "age_group") +# }
@@ -252,8 +252,8 @@ fill = "Interpretation", facet = NULL, breaks = seq(0, 1, 0.1), limits = NULL, translate_ab = "name", combine_SI = TRUE, combine_IR = FALSE, language = get_locale(), fun = count_df, - nrow = NULL, datalabels = TRUE, datalabels.size = 3, - datalabels.colour = "grey15", ...) + nrow = NULL, datalabels = FALSE, datalabels.size = 3, + datalabels.colour = "white", ...) geom_rsi(position = NULL, x = c("Antibiotic", "Interpretation"), fill = "Interpretation", translate_ab = "name", @@ -269,7 +269,7 @@ theme_rsi() labels_rsi_count(position = NULL, x = "Antibiotic", - datalabels.size = 3, datalabels.colour = "grey15") + datalabels.size = 3, datalabels.colour = "white")

Arguments

diff --git a/docs/reference/index.html b/docs/reference/index.html index a6b35ce7..48612a19 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -78,7 +78,7 @@ AMR (for R) - 0.6.1.9042 + 0.6.1.9043 diff --git a/git_premaster.sh b/git_premaster.sh index 59c7315a..8886a0fe 100755 --- a/git_premaster.sh +++ b/git_premaster.sh @@ -55,7 +55,7 @@ echo "•••••••••••••••••••••••• echo "• Uploading to repository •" echo "•••••••••••••••••••••••••••" git add . -git commit -a -m "$1" --quiet +git commit -a -m "(v$new_version) $1" --quiet git push --quiet echo "Comparison:" echo "https://gitlab.com/msberends/AMR/compare/master...premaster?view=inline" diff --git a/man/age_groups.Rd b/man/age_groups.Rd index cd0e5101..4186e44f 100644 --- a/man/age_groups.Rd +++ b/man/age_groups.Rd @@ -61,7 +61,7 @@ age_groups(ages, c(1, 2, 4, 6, 13, 17)) # 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) \%>\% diff --git a/man/ggplot_rsi.Rd b/man/ggplot_rsi.Rd index a3f8549a..1e49ba75 100644 --- a/man/ggplot_rsi.Rd +++ b/man/ggplot_rsi.Rd @@ -14,8 +14,8 @@ ggplot_rsi(data, position = NULL, x = "Antibiotic", fill = "Interpretation", facet = NULL, breaks = seq(0, 1, 0.1), limits = NULL, translate_ab = "name", combine_SI = TRUE, combine_IR = FALSE, language = get_locale(), fun = count_df, - nrow = NULL, datalabels = TRUE, datalabels.size = 3, - datalabels.colour = "grey15", ...) + nrow = NULL, datalabels = FALSE, datalabels.size = 3, + datalabels.colour = "white", ...) geom_rsi(position = NULL, x = c("Antibiotic", "Interpretation"), fill = "Interpretation", translate_ab = "name", @@ -31,7 +31,7 @@ scale_rsi_colours() theme_rsi() labels_rsi_count(position = NULL, x = "Antibiotic", - datalabels.size = 3, datalabels.colour = "grey15") + datalabels.size = 3, datalabels.colour = "white") } \arguments{ \item{data}{a \code{data.frame} with column(s) of class \code{"rsi"} (see \code{\link{as.rsi}})}