From 9060233953a7b42692056152679d77af6d6aedde Mon Sep 17 00:00:00 2001 From: "Matthijs S. Berends" Date: Mon, 4 Nov 2019 11:35:34 +0100 Subject: [PATCH] (v0.8.0.9010) mdro bug fix --- DESCRIPTION | 6 ++++-- NEWS.md | 5 +++-- R/mdro.R | 8 ++++---- docs/404.html | 2 +- docs/LICENSE-text.html | 2 +- docs/articles/index.html | 2 +- docs/authors.html | 6 +++++- docs/extra.js | 1 + docs/index.html | 2 +- docs/news/index.html | 11 ++++++----- docs/reference/index.html | 2 +- pkgdown/extra.js | 1 + 12 files changed, 29 insertions(+), 19 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 9452f0a7..de72b87d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: AMR -Version: 0.8.0.9009 -Date: 2019-11-03 +Version: 0.8.0.9010 +Date: 2019-11-04 Title: Antimicrobial Resistance Analysis Authors@R: c( person(role = c("aut", "cre"), @@ -25,6 +25,8 @@ Authors@R: c( family = "Lenglet", given = "Annick", email = "annick.lenglet@amsterdam.msf.org"), person(role = "ctb", family = "Meijer", given = c("Bart", "C."), email = "b.meijerg@certe.nl"), + person(role = "ctb", + family = "Ny", given = "Sofia", email = "sofia.ny@folkhalsomyndigheten.se"), person(role = "ctb", family = "Souverein", given = "Dennis", email = "d.souvereing@streeklabhaarlem.nl")) Description: Functions to simplify the analysis and prediction of Antimicrobial diff --git a/NEWS.md b/NEWS.md index c7175adb..fc9e9876 100755 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,5 @@ -# AMR 0.8.0.9009 -Last updated: 03-Nov-2019 +# AMR 0.8.0.9010 +Last updated: 04-Nov-2019 ### New * Support for a new MDRO guideline: Magiorakos AP, Srinivasan A *et al.* "Multidrug-resistant, extensively drug-resistant and pandrug-resistant bacteria: an international expert proposal for interim standard definitions for acquired resistance." Clinical Microbiology and Infection (2012). @@ -18,6 +18,7 @@ ### Other * Change dependency on `clean` to `cleaner`, as this package was renamed accordingly upon CRAN request +* Added Dr. Sofia Ny as contributor # AMR 0.8.0 diff --git a/R/mdro.R b/R/mdro.R index e488d8de..15a19dad 100755 --- a/R/mdro.R +++ b/R/mdro.R @@ -48,7 +48,7 @@ #' \item{Everything else:\cr Ordered factor with levels \code{Negative < Positive, unconfirmed < Positive}. The value \code{"Positive, unconfirmed"} means that, according to the guideline, it is not entirely sure if the isolate is multi-drug resistant and this should be confirmed with additional (e.g. molecular) tests} #' } #' @rdname mdro -#' @importFrom dplyr %>% filter_all +#' @importFrom dplyr %>% filter_at vars all_vars pull #' @importFrom crayon blue bold italic #' @importFrom cleaner percentage #' @export @@ -474,8 +474,8 @@ mdro <- function(x, function(row, group_tbl = lst) { sum(sapply(group_tbl, function(group) { - any(x[row, group[!is.na(group)]] == "R") | - any(x[row, group[!is.na(group)]] == "I") + any(x[row, group[!is.na(group)]] == "R", na.rm = TRUE) | + any(x[row, group[!is.na(group)]] == "I", na.rm = TRUE) }), na.rm = TRUE) }) @@ -975,7 +975,7 @@ mdro <- function(x, # Results ---- if (guideline$code == "cmi2012") { - if (any(x$MDRO == -1)) { + if (any(x$MDRO == -1, na.rm = TRUE)) { warning("NA introduced for isolates where the available percentage of antimicrobial classes was below ", percentage(pct_required_classes), " (set with `pct_required_classes`)") # set these -1s to NA diff --git a/docs/404.html b/docs/404.html index 0b15d515..e140062f 100644 --- a/docs/404.html +++ b/docs/404.html @@ -84,7 +84,7 @@ AMR (for R) - 0.8.0.9009 + 0.8.0.9010 diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index 06fef11a..91e37b81 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -84,7 +84,7 @@ AMR (for R) - 0.8.0.9009 + 0.8.0.9010 diff --git a/docs/articles/index.html b/docs/articles/index.html index 9cdfcec1..9433c5c1 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -84,7 +84,7 @@ AMR (for R) - 0.8.0.9009 + 0.8.0.9010 diff --git a/docs/authors.html b/docs/authors.html index 2f37b2a9..56db7999 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -84,7 +84,7 @@ AMR (for R) - 0.8.0.9009 + 0.8.0.9010 @@ -275,6 +275,10 @@

Bart C. Meijer. Contributor.

+
  • +

    Sofia Ny. Contributor. +

    +
  • Dennis Souverein. Contributor.

    diff --git a/docs/extra.js b/docs/extra.js index 960e0285..331f1ac6 100644 --- a/docs/extra.js +++ b/docs/extra.js @@ -87,6 +87,7 @@ $( document ).ready(function() { x = x.replace("Corinna", "Dr. Corinna"); // others x = x.replace("Bart", "Dr. Bart"); + x = x.replace("Sofia", "Dr. Sofia"); x = x.replace("Dennis", "Dr. Dennis"); x = x.replace("Judith", "Dr. Judith"); } diff --git a/docs/index.html b/docs/index.html index fee36aad..54e4eee8 100644 --- a/docs/index.html +++ b/docs/index.html @@ -45,7 +45,7 @@ AMR (for R) - 0.8.0.9009 + 0.8.0.9010 diff --git a/docs/news/index.html b/docs/news/index.html index 3d832dc1..b81fcb29 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -84,7 +84,7 @@ AMR (for R) - 0.8.0.9009 + 0.8.0.9010 @@ -231,11 +231,11 @@ -
    +

    -AMR 0.8.0.9009 Unreleased +AMR 0.8.0.9010 Unreleased

    -

    Last updated: 03-Nov-2019

    +

    Last updated: 04-Nov-2019

    New

    @@ -269,6 +269,7 @@ Other
    • Change dependency on clean to cleaner, as this package was renamed accordingly upon CRAN request
    • +
    • Added Dr. Sofia Ny as contributor
    @@ -1332,7 +1333,7 @@ Using as.mo(..., allow_uncertain = 3)

    Contents

    diff --git a/pkgdown/extra.js b/pkgdown/extra.js index 960e0285..331f1ac6 100644 --- a/pkgdown/extra.js +++ b/pkgdown/extra.js @@ -87,6 +87,7 @@ $( document ).ready(function() { x = x.replace("Corinna", "Dr. Corinna"); // others x = x.replace("Bart", "Dr. Bart"); + x = x.replace("Sofia", "Dr. Sofia"); x = x.replace("Dennis", "Dr. Dennis"); x = x.replace("Judith", "Dr. Judith"); }