From 0bb531f3e0aa886add70f955275fd4be9a85c8a1 Mon Sep 17 00:00:00 2001 From: "Matthijs S. Berends" Date: Sun, 3 Nov 2019 22:41:29 +0100 Subject: [PATCH] (v0.8.0.9009) unit test --- DESCRIPTION | 2 +- NEWS.md | 2 +- R/age.R | 2 ++ R/ggplot_rsi.R | 7 ++++--- R/mdro.R | 1 - docs/404.html | 2 +- docs/LICENSE-text.html | 2 +- docs/articles/index.html | 2 +- docs/authors.html | 2 +- docs/index.html | 2 +- docs/news/index.html | 8 ++++---- docs/reference/age_groups.html | 6 ++++-- docs/reference/ggplot_rsi.html | 9 +++++---- docs/reference/index.html | 2 +- docs/reference/mdro.html | 8 ++------ man/age_groups.Rd | 2 ++ man/ggplot_rsi.Rd | 5 +++-- man/mdro.Rd | 4 +--- 18 files changed, 35 insertions(+), 33 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 7bce8c0d..9452f0a7 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: AMR -Version: 0.8.0.9008 +Version: 0.8.0.9009 Date: 2019-11-03 Title: Antimicrobial Resistance Analysis Authors@R: c( diff --git a/NEWS.md b/NEWS.md index 8153b720..c7175adb 100755 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# AMR 0.8.0.9008 +# AMR 0.8.0.9009 Last updated: 03-Nov-2019 ### New diff --git a/R/age.R b/R/age.R index 4ebcb70e..55b00135 100755 --- a/R/age.R +++ b/R/age.R @@ -133,6 +133,7 @@ age <- function(x, reference = Sys.Date(), exact = FALSE, na.rm = FALSE) { #' # same: #' age_groups(ages, c(1, 2, 4, 6, 13, 17)) #' +#' \dontrun{ #' # resistance of ciprofloxacine per age group #' library(dplyr) #' example_isolates %>% @@ -141,6 +142,7 @@ age <- function(x, reference = Sys.Date(), exact = FALSE, na.rm = FALSE) { #' group_by(age_group = age_groups(age)) %>% #' select(age_group, CIP) %>% #' ggplot_rsi(x = "age_group") +#' } age_groups <- function(x, split_at = c(12, 25, 55, 75), na.rm = FALSE) { if (!is.numeric(x)) { stop("`x` and must be numeric, not a ", paste0(class(x), collapse = "/"), ".") diff --git a/R/ggplot_rsi.R b/R/ggplot_rsi.R index 2a7a953e..9e64bfa1 100755 --- a/R/ggplot_rsi.R +++ b/R/ggplot_rsi.R @@ -99,7 +99,9 @@ #' example_isolates %>% #' select(AMX) %>% #' ggplot_rsi(colours = c(SI = "yellow")) -#' +#' +#' \dontrun{ +#' #' # resistance of ciprofloxacine per age group #' example_isolates %>% #' mutate(first_isolate = first_isolate(.)) %>% @@ -110,8 +112,7 @@ #' select(age_group, #' CIP) %>% #' ggplot_rsi(x = "age_group") -#' \donttest{ -#' +#' #' # for colourblind mode, use divergent colours from the viridis package: #' example_isolates %>% #' select(AMX, NIT, FOS, TMP, CIP) %>% diff --git a/R/mdro.R b/R/mdro.R index ec990963..e488d8de 100755 --- a/R/mdro.R +++ b/R/mdro.R @@ -25,7 +25,6 @@ #' @param guideline a specific guideline to follow. When left empty, the publication by Magiorakos \emph{et al.} (2012, Clinical Microbiology and Infection) will be followed, see Details. #' @param info print progress #' @inheritParams eucast_rules -#' @param verbose print additional info: missing antibiotic columns per parameter #' @param pct_required_classes minimal required percentage of antimicrobial classes that must be available per isolate, rounded down. For example, with the default guideline, 17 antimicrobial classes must be available for \emph{S. aureus}. Setting this \code{pct_required_classes} argument to \code{0.5} (default) means that for every \emph{S. aureus} isolate at least 8 different classes must be available. Any lower number of available classes will return \code{NA} for that isolate. #' @param verbose a logical to turn Verbose mode on and off (default is off). In Verbose mode, the function does not return the MDRO results, but instead returns a data set in logbook form with extensive info about which isolates would be MDRO-positive, or why they are not. #' @inheritSection eucast_rules Antibiotics diff --git a/docs/404.html b/docs/404.html index a23546f3..0b15d515 100644 --- a/docs/404.html +++ b/docs/404.html @@ -84,7 +84,7 @@ AMR (for R) - 0.8.0.9008 + 0.8.0.9009 diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index d9a871a9..06fef11a 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -84,7 +84,7 @@ AMR (for R) - 0.8.0.9008 + 0.8.0.9009 diff --git a/docs/articles/index.html b/docs/articles/index.html index 463a45d8..9cdfcec1 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -84,7 +84,7 @@ AMR (for R) - 0.8.0.9008 + 0.8.0.9009 diff --git a/docs/authors.html b/docs/authors.html index 965cb58c..2f37b2a9 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -84,7 +84,7 @@ AMR (for R) - 0.8.0.9008 + 0.8.0.9009 diff --git a/docs/index.html b/docs/index.html index 2c98ae4d..fee36aad 100644 --- a/docs/index.html +++ b/docs/index.html @@ -45,7 +45,7 @@ AMR (for R) - 0.8.0.9008 + 0.8.0.9009 diff --git a/docs/news/index.html b/docs/news/index.html index 0b35e58b..3d832dc1 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -84,7 +84,7 @@ AMR (for R) - 0.8.0.9008 + 0.8.0.9009 @@ -231,9 +231,9 @@ -
+

-AMR 0.8.0.9008 Unreleased +AMR 0.8.0.9009 Unreleased

Last updated: 03-Nov-2019

@@ -1332,7 +1332,7 @@ Using as.mo(..., allow_uncertain = 3)

Contents

@@ -303,6 +303,7 @@ # same: age_groups(ages, c(1, 2, 4, 6, 13, 17)) +if (FALSE) { # resistance of ciprofloxacine per age group library(dplyr) example_isolates %>% @@ -310,7 +311,8 @@ filter(mo == as.mo("E. coli")) %>% group_by(age_group = age_groups(age)) %>% select(age_group, CIP) %>% - ggplot_rsi(x = "age_group") + ggplot_rsi(x = "age_group") +}
@@ -415,6 +415,8 @@ select(AMX) %>% ggplot_rsi(colours = c(SI = "yellow")) +if (FALSE) { + # resistance of ciprofloxacine per age group example_isolates %>% mutate(first_isolate = first_isolate(.)) %>% @@ -425,7 +427,6 @@ select(age_group, CIP) %>% ggplot_rsi(x = "age_group") -# \donttest{ # for colourblind mode, use divergent colours from the viridis package: example_isolates %>% @@ -453,7 +454,7 @@ # create new bacterial ID's, with all CoNS under the same group (Becker et al.) mutate(mo = as.mo(mo, Becker = TRUE)) %>% # filter on top three bacterial ID's - filter(mo %in% top_freq(freq(.$mo), 3)) %>% + filter(mo %in% top_freq(freq(.$mo), 3)) %>% # filter on first isolates filter_first_isolate() %>% # get short MO names (like "E. coli") @@ -471,7 +472,7 @@ subtitle = expression(paste("Only First Isolates, CoNS grouped according to Becker ", italic("et al."), " (2014)")), x.title = "Antibiotic (EARS-Net code)") -# } +}
diff --git a/docs/reference/mdro.html b/docs/reference/mdro.html index 5cbaef06..fe4e28f1 100644 --- a/docs/reference/mdro.html +++ b/docs/reference/mdro.html @@ -85,7 +85,7 @@ AMR (for R) - 0.8.0.9008 + 0.8.0.9009 @@ -271,7 +271,7 @@ verbose -

print additional info: missing antibiotic columns per parameter

+

a logical to turn Verbose mode on and off (default is off). In Verbose mode, the function does not return the MDRO results, but instead returns a data set in logbook form with extensive info about which isolates would be MDRO-positive, or why they are not.

pct_required_classes @@ -281,10 +281,6 @@ ...

column name of an antibiotic, see section Antibiotics

- - verbose -

a logical to turn Verbose mode on and off (default is off). In Verbose mode, the function does not return the MDRO results, but instead returns a data set in logbook form with extensive info about which isolates would be MDRO-positive, or why they are not.

-

Source

diff --git a/man/age_groups.Rd b/man/age_groups.Rd index e3b6bad2..ea760e19 100644 --- a/man/age_groups.Rd +++ b/man/age_groups.Rd @@ -60,6 +60,7 @@ age_groups(ages, "children") # same: age_groups(ages, c(1, 2, 4, 6, 13, 17)) +\dontrun{ # resistance of ciprofloxacine per age group library(dplyr) example_isolates \%>\% @@ -69,6 +70,7 @@ example_isolates \%>\% select(age_group, CIP) \%>\% ggplot_rsi(x = "age_group") } +} \seealso{ To determine ages, based on one or more reference dates, use the \code{\link{age}} function. } diff --git a/man/ggplot_rsi.Rd b/man/ggplot_rsi.Rd index 4073228f..bcc021b5 100644 --- a/man/ggplot_rsi.Rd +++ b/man/ggplot_rsi.Rd @@ -148,6 +148,8 @@ example_isolates \%>\% example_isolates \%>\% select(AMX) \%>\% ggplot_rsi(colours = c(SI = "yellow")) + +\dontrun{ # resistance of ciprofloxacine per age group example_isolates \%>\% @@ -159,8 +161,7 @@ example_isolates \%>\% select(age_group, CIP) \%>\% ggplot_rsi(x = "age_group") -\donttest{ - + # for colourblind mode, use divergent colours from the viridis package: example_isolates \%>\% select(AMX, NIT, FOS, TMP, CIP) \%>\% diff --git a/man/mdro.Rd b/man/mdro.Rd index 63acaf1c..0a24e077 100644 --- a/man/mdro.Rd +++ b/man/mdro.Rd @@ -34,13 +34,11 @@ eucast_exceptional_phenotypes(x, guideline = "EUCAST", ...) \item{info}{print progress} -\item{verbose}{print additional info: missing antibiotic columns per parameter} +\item{verbose}{a logical to turn Verbose mode on and off (default is off). In Verbose mode, the function does not return the MDRO results, but instead returns a data set in logbook form with extensive info about which isolates would be MDRO-positive, or why they are not.} \item{pct_required_classes}{minimal required percentage of antimicrobial classes that must be available per isolate, rounded down. For example, with the default guideline, 17 antimicrobial classes must be available for \emph{S. aureus}. Setting this \code{pct_required_classes} argument to \code{0.5} (default) means that for every \emph{S. aureus} isolate at least 8 different classes must be available. Any lower number of available classes will return \code{NA} for that isolate.} \item{...}{column name of an antibiotic, see section Antibiotics} - -\item{verbose}{a logical to turn Verbose mode on and off (default is off). In Verbose mode, the function does not return the MDRO results, but instead returns a data set in logbook form with extensive info about which isolates would be MDRO-positive, or why they are not.} } \value{ \itemize{