From 93428415d0f46a73dbc093c2f7723fff2a2bd2a5 Mon Sep 17 00:00:00 2001 From: "Matthijs S. Berends" Date: Mon, 16 Nov 2020 20:02:20 +0100 Subject: [PATCH] (v1.4.0.9022) small bugfix --- DESCRIPTION | 2 +- NEWS.md | 2 +- R/aa_helper_functions.R | 5 ++--- R/mo_property.R | 2 +- docs/404.html | 2 +- docs/LICENSE-text.html | 2 +- docs/articles/index.html | 2 +- docs/authors.html | 2 +- docs/index.html | 2 +- docs/news/index.html | 12 ++++++------ docs/pkgdown.yml | 2 +- docs/reference/index.html | 2 +- docs/survey.html | 2 +- 13 files changed, 19 insertions(+), 20 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 382f6d8b7..e85e5c976 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 5093c630a..1839e7fae 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 4002720d5..e53e1650b 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 ecc0abf04..d375ff73a 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 3a2193e77..c0c00da43 100644 --- a/docs/404.html +++ b/docs/404.html @@ -81,7 +81,7 @@ AMR (for R) - 1.4.0.9021 + 1.4.0.9022 diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index 7c6054133..bcc79324c 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -81,7 +81,7 @@ AMR (for R) - 1.4.0.9021 + 1.4.0.9022 diff --git a/docs/articles/index.html b/docs/articles/index.html index 537821e64..89a767579 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -81,7 +81,7 @@ AMR (for R) - 1.4.0.9021 + 1.4.0.9022 diff --git a/docs/authors.html b/docs/authors.html index 0b6aac47f..804edbc78 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -81,7 +81,7 @@ AMR (for R) - 1.4.0.9021 + 1.4.0.9022 diff --git a/docs/index.html b/docs/index.html index 43ae6c4cc..8cf902e70 100644 --- a/docs/index.html +++ b/docs/index.html @@ -43,7 +43,7 @@ AMR (for R) - 1.4.0.9021 + 1.4.0.9022 diff --git a/docs/news/index.html b/docs/news/index.html index f0936704d..0c08f9356 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -81,7 +81,7 @@ AMR (for R) - 1.4.0.9021 + 1.4.0.9022 @@ -236,9 +236,9 @@ Source: NEWS.md -
-

-AMR 1.4.0.9021 Unreleased +
+

+AMR 1.4.0.9022 Unreleased

@@ -252,14 +252,14 @@

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.

  • diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index 55b5488af..5cdea0381 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -12,7 +12,7 @@ articles: datasets: datasets.html resistance_predict: resistance_predict.html welcome_to_AMR: welcome_to_AMR.html -last_built: 2020-11-16T15:57Z +last_built: 2020-11-16T18:55Z urls: reference: https://msberends.github.io/AMR//reference article: https://msberends.github.io/AMR//articles diff --git a/docs/reference/index.html b/docs/reference/index.html index 91c18bcd9..d74359390 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -81,7 +81,7 @@ AMR (for R) - 1.4.0.9021 + 1.4.0.9022

    diff --git a/docs/survey.html b/docs/survey.html index 472e37076..16ad81daf 100644 --- a/docs/survey.html +++ b/docs/survey.html @@ -81,7 +81,7 @@ AMR (for R) - 1.4.0.9021 + 1.4.0.9022