From f758ab60f3fd5d59c49bb3c63de944fb00840667 Mon Sep 17 00:00:00 2001 From: Matthijs Berends Date: Fri, 14 Mar 2025 17:23:24 +0100 Subject: [PATCH] run MICs and disks if detected --- DESCRIPTION | 2 +- NEWS.md | 2 +- R/sir.R | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index abc0d3183..32195868a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: AMR -Version: 2.1.1.9201 +Version: 2.1.1.9202 Date: 2025-03-14 Title: Antimicrobial Resistance Data Analysis Description: Functions to simplify and standardise antimicrobial resistance (AMR) diff --git a/NEWS.md b/NEWS.md index ecf2538d8..24cba854c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# AMR 2.1.1.9201 +# AMR 2.1.1.9202 *(this beta version will eventually become v3.0. We're happy to reach a new major milestone soon, which will be all about the new One Health support! Install this beta using [the instructions here](https://msberends.github.io/AMR/#latest-development-version).)* diff --git a/R/sir.R b/R/sir.R index 85a2ce907..71e512d86 100755 --- a/R/sir.R +++ b/R/sir.R @@ -496,9 +496,11 @@ as.sir.default <- function(x, if (all(x %unlike% "(S|I|R)", na.rm = TRUE)) { # check if they are actually MICs or disks if (all_valid_mics(x)) { - warning_("in `as.sir()`: the input seems to contain MIC values. You can transform them with `as.mic()` before running `as.sir()` to interpret them.") + warning_("in `as.sir()`: input values were guessed to be MIC values - preferably transform them with `as.mic()` before running `as.sir()`.") + return(as.sir(as.mic(x), ...)) } else if (all_valid_disks(x)) { - warning_("in `as.sir()`: the input seems to contain disk diffusion values. You can transform them with `as.disk()` before running `as.sir()` to interpret them.") + warning_("in `as.sir()`: input values were guessed to be disk diffusion values - preferably transform them with `as.disk()` before running `as.sir()`.") + return(as.sir(as.disk(x), ...)) } }