diff --git a/DESCRIPTION b/DESCRIPTION index d23fe9cd..65ee3f40 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: AMR -Version: 0.7.1.9065 +Version: 0.7.1.9066 Date: 2019-08-27 Title: Antimicrobial Resistance Analysis Authors@R: c( diff --git a/NEWS.md b/NEWS.md index 3fc61873..6d157a75 100755 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# AMR 0.7.1.9065 +# AMR 0.7.1.9066 ### Breaking * Determination of first isolates now **excludes** all 'unknown' microorganisms at default, i.e. microbial code `"UNKNOWN"`. They can be included with the new parameter `include_unknown`: diff --git a/R/bug_drug_combinations.R b/R/bug_drug_combinations.R index bf3ff3d1..fb893da0 100644 --- a/R/bug_drug_combinations.R +++ b/R/bug_drug_combinations.R @@ -25,6 +25,7 @@ #' @inheritParams eucast_rules #' @param combine_IR logical to indicate whether values R and I should be summed #' @param add_ab_group logical to indicate where the group of the antimicrobials must be included as a first column +#' @param ... argumments passed on to \code{\link{mo_name}} #' @inheritParams rsi_df #' @importFrom dplyr rename #' @importFrom tidyr spread @@ -75,14 +76,14 @@ bug_drug_combinations <- function(x, col_mo = NULL, minimum = 30) { #' @exportMethod format.bug_drug_combinations #' @export #' @rdname bug_drug_combinations -format.bug_drug_combinations <- function(x, combine_IR = FALSE, add_ab_group = TRUE) { +format.bug_drug_combinations <- function(x, combine_IR = FALSE, add_ab_group = TRUE, ...) { if (combine_IR == FALSE) { x$isolates <- x$R } else { x$isolates <- x$R + x$I } y <- x %>% - mutate(mo = mo_name(mo), + mutate(mo = mo_name(mo, ...), txt = paste0(percent(isolates / total, force_zero = TRUE), " (", trimws(format(isolates, big.mark = ",")), "/", trimws(format(total, big.mark = ",")), ")")) %>% diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index 70932de4..37891d44 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -78,7 +78,7 @@ AMR (for R) - 0.7.1.9065 + 0.7.1.9066 diff --git a/docs/articles/index.html b/docs/articles/index.html index 5ead41b0..1533f23e 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -78,7 +78,7 @@ AMR (for R) - 0.7.1.9065 + 0.7.1.9066 diff --git a/docs/authors.html b/docs/authors.html index 48329d08..aeb82a0a 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -78,7 +78,7 @@ AMR (for R) - 0.7.1.9065 + 0.7.1.9066 diff --git a/docs/index.html b/docs/index.html index 4166c1a2..85b8b772 100644 --- a/docs/index.html +++ b/docs/index.html @@ -42,7 +42,7 @@ AMR (for R) - 0.7.1.9065 + 0.7.1.9066 diff --git a/docs/news/index.html b/docs/news/index.html index 59f217d0..d4f7b5db 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -78,7 +78,7 @@ AMR (for R) - 0.7.1.9065 + 0.7.1.9066 @@ -225,9 +225,9 @@ -
+

-AMR 0.7.1.9065 Unreleased +AMR 0.7.1.9066 Unreleased

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

Contents

@@ -238,7 +238,7 @@ # S3 method for bug_drug_combinations format(x, combine_IR = FALSE, - add_ab_group = TRUE) + add_ab_group = TRUE, ...)

Arguments

@@ -263,6 +263,10 @@ + + + +
add_ab_group

logical to indicate where the group of the antimicrobials must be included as a first column

...

argumments passed on to mo_name

Source

diff --git a/docs/reference/index.html b/docs/reference/index.html index 74509f21..e1f0229c 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -78,7 +78,7 @@ AMR (for R) - 0.7.1.9065 + 0.7.1.9066
diff --git a/man/bug_drug_combinations.Rd b/man/bug_drug_combinations.Rd index 136c2aee..6048deee 100644 --- a/man/bug_drug_combinations.Rd +++ b/man/bug_drug_combinations.Rd @@ -11,7 +11,7 @@ bug_drug_combinations(x, col_mo = NULL, minimum = 30) \method{format}{bug_drug_combinations}(x, combine_IR = FALSE, - add_ab_group = TRUE) + add_ab_group = TRUE, ...) } \arguments{ \item{x}{data with antibiotic columns, like e.g. \code{AMX} and \code{AMC}} @@ -23,6 +23,8 @@ bug_drug_combinations(x, col_mo = NULL, minimum = 30) \item{combine_IR}{logical to indicate whether values R and I should be summed} \item{add_ab_group}{logical to indicate where the group of the antimicrobials must be included as a first column} + +\item{...}{argumments passed on to \code{\link{mo_name}}} } \description{ Determine antimicrobial resistance (AMR) of all bug-drug combinations in your data set where at least 30 (default) isolates are available per species. Use \code{format} on the result to prettify it to a printable format, see Examples. diff --git a/tests/testthat/test-bug_drug_combinations.R b/tests/testthat/test-bug_drug_combinations.R index 5f68d8be..2cd34701 100644 --- a/tests/testthat/test-bug_drug_combinations.R +++ b/tests/testthat/test-bug_drug_combinations.R @@ -23,7 +23,7 @@ context("bug_drug_combinations.R") test_that("bug_drug_combinations works", { b <- suppressWarnings(bug_drug_combinations(example_isolates)) - expect_s3_class(b, "bugdrug") + expect_s3_class(b, "bug_drug_combinations") expect_message(print(b)) expect_true(is.data.frame(format(b))) })