diff --git a/DESCRIPTION b/DESCRIPTION index 85f4fffb..29b9f39c 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: AMR -Version: 1.8.1.9009 +Version: 1.8.1.9010 Date: 2022-05-16 Title: Antimicrobial Resistance Data Analysis Description: Functions to simplify and standardise antimicrobial resistance (AMR) diff --git a/NEWS.md b/NEWS.md index ee9b6b3a..d75c7fc2 100755 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# `AMR` 1.8.1.9009 +# `AMR` 1.8.1.9010 ## Last updated: 16 May 2022 ### New diff --git a/R/mic.R b/R/mic.R index d5a9e938..e3c5f795 100755 --- a/R/mic.R +++ b/R/mic.R @@ -47,6 +47,7 @@ valid_mic_levels <- c(c(t(vapply(FUN.VALUE = character(9), ops, #' @rdname as.mic #' @param x a [character] or [numeric] vector #' @param na.rm a [logical] indicating whether missing values should be removed +#' @param ... arguments passed on to methods #' @details To interpret MIC values as RSI values, use [as.rsi()] on MIC values. It supports guidelines from EUCAST (`r min(as.integer(gsub("[^0-9]", "", subset(rsi_translation, guideline %like% "EUCAST")$guideline)))`-`r max(as.integer(gsub("[^0-9]", "", subset(rsi_translation, guideline %like% "EUCAST")$guideline)))`) and CLSI (`r min(as.integer(gsub("[^0-9]", "", subset(rsi_translation, guideline %like% "CLSI")$guideline)))`-`r max(as.integer(gsub("[^0-9]", "", subset(rsi_translation, guideline %like% "CLSI")$guideline)))`). #' #' This class for MIC values is a quite a special data type: formally it is an ordered [factor] with valid MIC values as [factor] levels (to make sure only valid MIC values are retained), but for any mathematical operation it acts as decimal numbers: @@ -228,11 +229,10 @@ as.numeric.mic <- function(x, ...) { #' @rdname as.mic #' @method droplevels mic -#' @param exclude factor levels which should be excluded from the result even if present, see [droplevels()][base::droplevels()] #' @param as.mic a [logical] to indicate whether the `` class should be kept, defaults to `FALSE` #' @export -droplevels.mic <- function(x, exclude = if (any(is.na(levels(x)))) NULL else NA, as.mic = FALSE, ...) { - x <- droplevels.factor(x, exclude = exclude, ...) +droplevels.mic <- function(x, as.mic = FALSE, ...) { + x <- droplevels.factor(x, ...) if (as.mic == TRUE) { class(x) <- c("mic", "ordered", "factor") } diff --git a/data-raw/AMR_latest.tar.gz b/data-raw/AMR_latest.tar.gz index 71b442fa..a8b51104 100644 Binary files a/data-raw/AMR_latest.tar.gz and b/data-raw/AMR_latest.tar.gz differ diff --git a/docs/404.html b/docs/404.html index c87b28f2..f77db2be 100644 --- a/docs/404.html +++ b/docs/404.html @@ -43,7 +43,7 @@ AMR (for R) - 1.8.1.9009 + 1.8.1.9010 diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index 4e5d23a5..ea004b66 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -17,7 +17,7 @@ AMR (for R) - 1.8.1.9009 + 1.8.1.9010 diff --git a/docs/articles/datasets.html b/docs/articles/datasets.html index 6061c91c..c9b84f76 100644 --- a/docs/articles/datasets.html +++ b/docs/articles/datasets.html @@ -44,7 +44,7 @@ AMR (for R) - 1.8.1.9009 + 1.8.1.9010 diff --git a/docs/authors.html b/docs/authors.html index d7f1aff8..ed3c5d97 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -17,7 +17,7 @@ AMR (for R) - 1.8.1.9009 + 1.8.1.9010 diff --git a/docs/index.html b/docs/index.html index 4d39eb1b..42694c9c 100644 --- a/docs/index.html +++ b/docs/index.html @@ -47,7 +47,7 @@ AMR (for R) - 1.8.1.9009 + 1.8.1.9010 diff --git a/docs/news/index.html b/docs/news/index.html index 48525451..2e3d1591 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -17,7 +17,7 @@ AMR (for R) - 1.8.1.9009 + 1.8.1.9010 @@ -157,16 +157,16 @@
- +
-

Last updated: 16 May 2022

+

Last updated: 16 May 2022

-

New

+

New

  • EUCAST 2022 and CLSI 2022 guidelines have been added for as.rsi(). EUCAST 2022 is now the new default guideline for all MIC and disks diffusion interpretations.
-

Changed

+

Changed

  • Fix for as.rsi() on certain EUCAST breakpoints for MIC values
  • Removed as.integer() for MIC values, since MIC are not integer values and running table() on MIC values consequently failed for not being able to retrieve the level position (as that’s how normally as.integer() on factors work)
  • diff --git a/docs/reference/as.mic.html b/docs/reference/as.mic.html index 66a5dcdd..43aa4cf4 100644 --- a/docs/reference/as.mic.html +++ b/docs/reference/as.mic.html @@ -17,7 +17,7 @@ AMR (for R) - 1.8.1.9007 + 1.8.1.9010
@@ -169,12 +169,7 @@ is.mic(x) # S3 method for mic -droplevels( - x, - exclude = if (any(is.na(levels(x)))) NULL else NA, - as.mic = FALSE, - ... -)
+droplevels(x, as.mic = FALSE, ...)
@@ -183,10 +178,10 @@

a character or numeric vector

na.rm

a logical indicating whether missing values should be removed

-
exclude
-

factor levels which should be excluded from the result even if present, see droplevels()

as.mic

a logical to indicate whether the <mic> class should be kept, defaults to FALSE

+
...
+

arguments passed on to methods

Value

diff --git a/docs/reference/index.html b/docs/reference/index.html index 5b35de2c..9fab2958 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -17,7 +17,7 @@ AMR (for R) - 1.8.1.9009 + 1.8.1.9010
diff --git a/docs/survey.html b/docs/survey.html index 022eb7a2..2732c78b 100644 --- a/docs/survey.html +++ b/docs/survey.html @@ -17,7 +17,7 @@ AMR (for R) - 1.8.1.9009 + 1.8.1.9010 diff --git a/man/as.mic.Rd b/man/as.mic.Rd index b5d127ef..bce228bd 100755 --- a/man/as.mic.Rd +++ b/man/as.mic.Rd @@ -15,21 +15,16 @@ NA_mic_ is.mic(x) -\method{droplevels}{mic}( - x, - exclude = if (any(is.na(levels(x)))) NULL else NA, - as.mic = FALSE, - ... -) +\method{droplevels}{mic}(x, as.mic = FALSE, ...) } \arguments{ \item{x}{a \link{character} or \link{numeric} vector} \item{na.rm}{a \link{logical} indicating whether missing values should be removed} -\item{exclude}{factor levels which should be excluded from the result even if present, see \link[base:droplevels]{droplevels()}} - \item{as.mic}{a \link{logical} to indicate whether the \verb{} class should be kept, defaults to \code{FALSE}} + +\item{...}{arguments passed on to methods} } \value{ Ordered \link{factor} with additional class \code{\link{mic}}, that in mathematical operations acts as decimal numbers. Bare in mind that the outcome of any mathematical operation on MICs will return a \link{numeric} value.