diff --git a/DESCRIPTION b/DESCRIPTION index 124c25b80..e2187ea8f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: AMR -Version: 2.1.1.9219 +Version: 2.1.1.9220 Date: 2025-03-19 Title: Antimicrobial Resistance Data Analysis Description: Functions to simplify and standardise antimicrobial resistance (AMR) diff --git a/NEWS.md b/NEWS.md index b8314163c..87baa98df 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# AMR 2.1.1.9219 +# AMR 2.1.1.9220 *(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/ab.R b/R/ab.R index 23c6fbf1b..d7e29c9fa 100755 --- a/R/ab.R +++ b/R/ab.R @@ -358,7 +358,7 @@ as.ab <- function(x, flag_multiple_results = TRUE, language = get_AMR_locale(), FUN.VALUE = double(1), ab_df$generalised_synonyms, function(y) { - ifelse(length(y[nchar(y) >= 5]) == 0, + ifelse(all(is.na(y)) || length(y[nchar(y) >= 5]) == 0, 999, min(as.double(utils::adist(x[i], y[nchar(y) >= 5], ignore.case = FALSE, diff --git a/R/amr_selectors.R b/R/amr_selectors.R index 51d5b0ad4..fafdce1cf 100755 --- a/R/amr_selectors.R +++ b/R/amr_selectors.R @@ -955,7 +955,7 @@ any.amr_selector_any_all <- function(..., na.rm = FALSE) { `+.amr_selector` <- function(e1, e2) { # this is useful for `antibiogram()`: antibiogram(example_isolates, carbapenems() + c("", "GEN", "TOB")) structure(as.character(outer(e1, e2, paste, sep = " + ")), - class = c("amr_selector", "character") + class = c("amr_selector", "character") ) } diff --git a/R/antibiogram.R b/R/antibiogram.R index 771413a7c..6ba5db248 100755 --- a/R/antibiogram.R +++ b/R/antibiogram.R @@ -336,7 +336,7 @@ #' antimicrobials = c("TZP", "TZP+TOB", "TZP+GEN"), #' mo_transform = "gramstain" #' ) -#' +#' #' # you can use any antimicrobial selector with `+` too: #' antibiogram(example_isolates, #' antimicrobials = ureidopenicillins() + c("", "GEN", "tobra"), diff --git a/data-raw/gpt_training_text_v2.1.1.9219.txt b/data-raw/gpt_training_text_v2.1.1.9220.txt similarity index 99% rename from data-raw/gpt_training_text_v2.1.1.9219.txt rename to data-raw/gpt_training_text_v2.1.1.9220.txt index 570510216..40d5ae7a6 100644 --- a/data-raw/gpt_training_text_v2.1.1.9219.txt +++ b/data-raw/gpt_training_text_v2.1.1.9220.txt @@ -1,6 +1,6 @@ This knowledge base contains all context you must know about the AMR package for R. You are a GPT trained to be an assistant for the AMR package in R. You are an incredible R specialist, especially trained in this package and in the tidyverse. -First and foremost, you are trained on version 2.1.1.9219. Remember this whenever someone asks which AMR package version you’re at. +First and foremost, you are trained on version 2.1.1.9220. Remember this whenever someone asks which AMR package version you’re at. Below are the contents of the NAMESPACE file, the index.md file, and all the man/*.Rd files (documentation) in the package. Every file content is split using 100 hypens. ----------------------------------------------------------------------------------------------------