diff --git a/DESCRIPTION b/DESCRIPTION
index 787073fb..29954dc8 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,5 +1,5 @@
Package: AMR
-Version: 1.5.0.9008
+Version: 1.5.0.9009
Date: 2021-01-22
Title: Antimicrobial Resistance Analysis
Authors@R: c(
diff --git a/NEWS.md b/NEWS.md
index 5cbbc5b5..c31e390f 100755
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,4 +1,4 @@
-# AMR 1.5.0.9008
+# AMR 1.5.0.9009
## Last updated: 22 January 2021
### New
diff --git a/R/aa_helper_functions.R b/R/aa_helper_functions.R
index 15b470ef..fc5dbbb0 100755
--- a/R/aa_helper_functions.R
+++ b/R/aa_helper_functions.R
@@ -479,10 +479,13 @@ format_class <- function(class, plural) {
if ("matrix" %in% class) {
class <- "a matrix"
}
- if (any(c("mo", "ab", "rsi", "disk", "mic") %in% class)) {
- class <- paste0("a class <", class[1L], ">")
+ if ("isolate_identifier" %in% class) {
+ class <- "created with isolate_identifier()"
}
- class[class == class.bak] <- paste0("a class <", class[class == class.bak], ">")
+ if (any(c("mo", "ab", "rsi", "disk", "mic") %in% class)) {
+ class <- paste0("of class <", class[1L], ">")
+ }
+ class[class == class.bak] <- paste0("of class <", class[class == class.bak], ">")
# output
vector_or(class, quotes = FALSE)
}
@@ -514,7 +517,7 @@ meet_criteria <- function(object,
if (!is.null(allow_class)) {
stop_ifnot(inherits(object, allow_class), "argument `", obj_name,
"` must be ", format_class(allow_class, plural = isTRUE(has_length > 1)),
- ", not ", format_class(class(object), plural = isTRUE(has_length > 1)),
+ ", i.e. not be ", format_class(class(object), plural = isTRUE(has_length > 1)),
call = call_depth)
# check data.frames for data
if (inherits(object, "data.frame")) {
diff --git a/R/isolate_identifier.R b/R/isolate_identifier.R
index 94a2c49c..84bc8323 100644
--- a/R/isolate_identifier.R
+++ b/R/isolate_identifier.R
@@ -83,9 +83,15 @@ isolate_identifier <- function(x, col_mo = NULL, cols_ab = NULL) {
}
#' @method all.equal isolate_identifier
+#' @inheritParams base::all.equal
+#' @param ignore_empty_results a logical to indicate whether empty results must be ignored, so that only values R, S and I will be compared
#' @rdname isolate_identifier
#' @export
all.equal.isolate_identifier <- function(target, current, ignore_empty_results = TRUE, ...) {
+ meet_criteria(target, allow_class = "isolate_identifier")
+ meet_criteria(current, allow_class = "isolate_identifier")
+ meet_criteria(ignore_empty_results, allow_class = "logical", has_length = 1)
+
if (isTRUE(all.equal.character(target, current))) {
return(TRUE)
}
diff --git a/data-raw/AMR_1.5.0.9008.tar.gz b/data-raw/AMR_1.5.0.9009.tar.gz
similarity index 87%
rename from data-raw/AMR_1.5.0.9008.tar.gz
rename to data-raw/AMR_1.5.0.9009.tar.gz
index 231e2b61..0fc93b8c 100644
Binary files a/data-raw/AMR_1.5.0.9008.tar.gz and b/data-raw/AMR_1.5.0.9009.tar.gz differ
diff --git a/docs/404.html b/docs/404.html
index b2626d44..448c8675 100644
--- a/docs/404.html
+++ b/docs/404.html
@@ -81,7 +81,7 @@
NEWS.md
-
a character vector of column names of x
, or (a combination with) an antibiotic selector function, such as carbapenems()
and aminoglycosides()
R object.
other R object, to be compared with target
.
a logical to indicate whether empty results must be ignored, so that only values R, S and I will be compared
column name of an antibiotic, see section Antibiotics below