diff --git a/DESCRIPTION b/DESCRIPTION
index 382f6d8b..e85e5c97 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,5 +1,5 @@
Package: AMR
-Version: 1.4.0.9021
+Version: 1.4.0.9022
Date: 2020-11-16
Title: Antimicrobial Resistance Analysis
Authors@R: c(
diff --git a/NEWS.md b/NEWS.md
index 5093c630..1839e7fa 100755
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,4 +1,4 @@
-# AMR 1.4.0.9021
+# AMR 1.4.0.9022
## Last updated: 16 November 2020
### New
diff --git a/R/aa_helper_functions.R b/R/aa_helper_functions.R
index 4002720d..e53e1650 100755
--- a/R/aa_helper_functions.R
+++ b/R/aa_helper_functions.R
@@ -79,8 +79,7 @@ addin_insert_like <- function() {
modifyRange <- import_fn("insertText", "rstudioapi")
document_range <- import_fn("document_range", "rstudioapi")
document_position <- import_fn("document_position", "rstudioapi")
- # setSelectionRanges <- import_fn("setSelectionRanges", "rstudioapi")
-
+
context <- getSourceEditorContext()
current_row <- context$selection[[1]]$range$end[1]
current_col <- context$selection[[1]]$range$end[2]
@@ -688,7 +687,7 @@ set_clean_class <- function(x, new_class) {
lvls <- levels(x)
attributes(x) <- NULL
levels(x) <- lvls
- } else {
+ } else if (!is.list(x) && !is.function(x)) {
attributes(x) <- NULL
}
class(x) <- new_class
diff --git a/R/mo_property.R b/R/mo_property.R
index ecc0abf0..d375ff73 100755
--- a/R/mo_property.R
+++ b/R/mo_property.R
@@ -598,7 +598,7 @@ mo_validate <- function(x, property, language, ...) {
}
if (property == "mo") {
- return(to_class_mo(x))
+ return(set_clean_class(x, new_class = c("mo", "character")))
} else if (property == "snomed") {
return(as.double(eval(parse(text = x))))
} else {
diff --git a/docs/404.html b/docs/404.html
index 3a2193e7..c0c00da4 100644
--- a/docs/404.html
+++ b/docs/404.html
@@ -81,7 +81,7 @@
NEWS.md
-
Functions mo_is_gram_negative()
and mo_is_gram_positive()
as wrappers around mo_gramstain()
. They always return TRUE
or FALSE
(except when the input is NA
or the MO code is UNKNOWN
), thus always return FALSE
for species outside the taxonomic kingdom of Bacteria. If you have the dplyr
package installed, they can even determine the column with microorganisms themselves when used inside dplyr
verbs:
example_isolates %>% - filter(mo_is_gram_positive()) + filter(mo_is_gram_positive()) #> NOTE: Using column `mo` as input for mo_is_gram_positive()
Function mo_is_intrinsic_resistant()
to test for intrinsic resistance, based on EUCAST Intrinsic Resistance and Unusual Phenotypes v3.2 from 2020. As with the new mo_is_gram_*()
functions, if you have the dplyr
package installed the column with microorganisms will be automatically determined when used inside dplyr
verbs:
example_isolates %>% - filter(mo_is_intrinsic_resistant(ab = "Vancomycin")) + filter(mo_is_intrinsic_resistant(ab = "Vancomycin")) #> NOTE: Using column `mo` as input for mo_is_intrinsic_resistant()
Functions %not_like%
and %not_like_case%
as wrappers around %like%
and %like_case%
. The RStudio addin to insert the text " %like% " as provided in this package now iterates over all like variants. So if you have defined the keyboard shortcut Ctrl/Cmd + L to this addin, it will first insert %like%
and by pressing it again it will be replaced with %not_like%
, etc.