diff --git a/DESCRIPTION b/DESCRIPTION index d33399a2..ab62cd49 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: AMR -Version: 0.7.1.9093 +Version: 0.7.1.9094 Date: 2019-10-06 Title: Antimicrobial Resistance Analysis Authors@R: c( diff --git a/NEWS.md b/NEWS.md index 7ec3c834..f9c4bfa6 100755 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# AMR 0.7.1.9093 +# AMR 0.7.1.9094 Last updated: 06-Oct-2019 ### Breaking @@ -102,7 +102,7 @@ * Printed info now distinguishes between added and changes values * Using Verbose mode (i.e. `eucast_rules(..., verbose = TRUE)`) returns more informative and readable output * Using factors as input now adds missing factors levels when the function changes antibiotic results -* Improved the internal auto-guessing function for determining antibiotics in your data set (`AMR:::get_column_abx()`) +* Improved the internal auto-guessing function for determining antimicrobials in your data set (`AMR:::get_column_abx()`) * Removed class `atc` - using `as.atc()` is now deprecated in favour of `ab_atc()` and this will return a character, not the `atc` class anymore * Removed deprecated functions `abname()`, `ab_official()`, `atc_name()`, `atc_official()`, `atc_property()`, `atc_tradenames()`, `atc_trivial_nl()` * Fix and speed improvement for `mo_shortname()` diff --git a/R/eucast_rules.R b/R/eucast_rules.R index 38386178..5f51bcf8 100755 --- a/R/eucast_rules.R +++ b/R/eucast_rules.R @@ -191,7 +191,7 @@ eucast_rules <- function(x, txt <- paste0("WARNING: In Verbose mode, the eucast_rules() function does not apply rules to the data, but instead returns a data set in logbook form with extensive info about which rows and columns would be effected and in which way.", "\n\nThis may overwrite your existing data if you use e.g.:", "\ndata <- eucast_rules(data, verbose = TRUE)\n\nDo you want to continue?") - if ("rstudioapi" %in% rownames(installed.packages())) { + if ("rstudioapi" %in% rownames(utils::installed.packages())) { q_continue <- rstudioapi::showQuestion("Using verbose = TRUE with eucast_rules()", txt) } else { q_continue <- menu(choices = c("OK", "Cancel"), graphics = TRUE, title = txt) diff --git a/R/guess_ab_col.R b/R/guess_ab_col.R index ce7a9161..36d9686c 100755 --- a/R/guess_ab_col.R +++ b/R/guess_ab_col.R @@ -122,11 +122,21 @@ get_column_abx <- function(x, ...) { # determine from given data set + x_bak <- x df_trans <- data.frame(colnames = colnames(x), abcode = suppressWarnings(as.ab(colnames(x)))) df_trans <- df_trans[!is.na(df_trans$abcode),] x <- as.character(df_trans$colnames) names(x) <- df_trans$abcode + + # remove the ones that do not already have the rsi class (as.rsi) and that have >50% invalid values + x <- sapply(x, function(col = x, df = x_bak) { + ifelse(is.rsi(as.data.frame(df)[, col]) | + is.rsi.eligible(as.data.frame(df)[, col], threshold = 0.5), + col, + NA) + }) + x <- x[!is.na(x)] # add from self-defined dots (...): # get_column_abx(example_isolates %>% rename(thisone = AMX), amox = "thisone") diff --git a/docs/404.html b/docs/404.html index e98eb780..e62383e0 100644 --- a/docs/404.html +++ b/docs/404.html @@ -84,7 +84,7 @@ AMR (for R) - 0.7.1.9093 + 0.7.1.9094 diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index 4ef934f1..75c1a9d9 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -84,7 +84,7 @@ AMR (for R) - 0.7.1.9093 + 0.7.1.9094 diff --git a/docs/articles/index.html b/docs/articles/index.html index d144aec7..f6861e1b 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -84,7 +84,7 @@ AMR (for R) - 0.7.1.9093 + 0.7.1.9094 diff --git a/docs/authors.html b/docs/authors.html index 577e8afc..8d763fbb 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -84,7 +84,7 @@ AMR (for R) - 0.7.1.9093 + 0.7.1.9094 diff --git a/docs/index.html b/docs/index.html index 98fcca0b..6c689cad 100644 --- a/docs/index.html +++ b/docs/index.html @@ -43,7 +43,7 @@ AMR (for R) - 0.7.1.9093 + 0.7.1.9094 diff --git a/docs/news/index.html b/docs/news/index.html index 2efc5dc9..4fadc1e8 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -84,7 +84,7 @@ AMR (for R) - 0.7.1.9093 + 0.7.1.9094 @@ -231,9 +231,9 @@ -
+

-AMR 0.7.1.9093 Unreleased +AMR 0.7.1.9094 Unreleased

Last updated: 06-Oct-2019

@@ -349,7 +349,7 @@ Since this is a major change, usage of the old also_single_tested w
  • Using factors as input now adds missing factors levels when the function changes antibiotic results
  • -
  • Improved the internal auto-guessing function for determining antibiotics in your data set (AMR:::get_column_abx())
  • +
  • Improved the internal auto-guessing function for determining antimicrobials in your data set (AMR:::get_column_abx())
  • Removed class atc - using as.atc() is now deprecated in favour of ab_atc() and this will return a character, not the atc class anymore
  • Removed deprecated functions abname(), ab_official(), atc_name(), atc_official(), atc_property(), atc_tradenames(), atc_trivial_nl()
  • @@ -1289,7 +1289,7 @@ Using as.mo(..., allow_uncertain = 3)

    Contents