diff --git a/DESCRIPTION b/DESCRIPTION index c44161f3..e5420975 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: AMR -Version: 0.7.1.9070 -Date: 2019-09-02 +Version: 0.7.1.9071 +Date: 2019-09-03 Title: Antimicrobial Resistance Analysis Authors@R: c( person(role = c("aut", "cre"), diff --git a/NAMESPACE b/NAMESPACE index 2be34a53..5d8cef10 100755 --- a/NAMESPACE +++ b/NAMESPACE @@ -163,6 +163,7 @@ export(mo_year) export(mrgn) export(n_rsi) export(p.symbol) +export(p_symbol) export(portion_I) export(portion_IR) export(portion_R) diff --git a/NEWS.md b/NEWS.md index 375f3054..51260642 100755 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,5 @@ -# AMR 0.7.1.9070 -Last updated: 02-Sep-2019 +# AMR 0.7.1.9071 +Last updated: 03-Sep-2019 ### Breaking * Determination of first isolates now **excludes** all 'unknown' microorganisms at default, i.e. microbial code `"UNKNOWN"`. They can be included with the new parameter `include_unknown`: @@ -98,6 +98,7 @@ * Improved `filter_ab_class()` to be more reliable and to support 5th generation cephalosporins * Function `availability()` now uses `portion_R()` instead of `portion_IR()`, to comply with EUCAST insights * Functions `age()` and `age_groups()` now have a `na.rm` parameter to remove empty values +* Renamed function `p.symbol()` to `p_symbol()` (the former is now deprecated and will be removed in a future version) #### Other * Added Prof Dr Casper Albers as doctoral advisor and Dr Bart Meijer, Dr Dennis Souverein and Annick Lenglet as contributors diff --git a/R/deprecated.R b/R/deprecated.R index 7f75e9e5..8a2f34de 100755 --- a/R/deprecated.R +++ b/R/deprecated.R @@ -31,3 +31,10 @@ as.atc <- function(x) { .Deprecated("ab_atc", package = "AMR") AMR::ab_atc(x) } + +#' @rdname AMR-deprecated +#' @export +p.symbol <- function(...) { + .Deprecated("p_symbol", package = "AMR") + AMR::p_symbol(...) +} diff --git a/R/p.symbol.R b/R/p_symbol.R similarity index 73% rename from R/p.symbol.R rename to R/p_symbol.R index ffd4c8a2..79110bf5 100755 --- a/R/p.symbol.R +++ b/R/p_symbol.R @@ -27,34 +27,16 @@ #' @return Text #' @inheritSection AMR Read more on our website! #' @export -p.symbol <- function(p, emptychar = " ") { - setting.bak <- options()$scipen - options(scipen = 999) - s <- vector(mode = "character", length = length(p)) - for (i in 1:length(p)) { - if (is.na(p[i])) { - s[i] <- NA_character_ - next - } - if (p[i] > 1) { - s[i] <- NA_character_ - next - } else { - p_test <- p[i] - } +p_symbol <- function(p, emptychar = " ") { - if (p_test > 0.1) { - s[i] <- emptychar - } else if (p_test > 0.05) { - s[i] <- '.' - } else if (p_test > 0.01) { - s[i] <- '*' - } else if (p_test > 0.001) { - s[i] <- '**' - } else if (p_test >= 0) { - s[i] <- '***' - } - } - options(scipen = setting.bak) + p <- as.double(p) + s <- rep(NA_character_, length(p)) + + s[p <= 1] <- emptychar + s[p <= 0.100] <- "." + s[p <= 0.050] <- "*" + s[p <= 0.010] <- "**" + s[p <= 0.001] <- "***" + s } diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index e9ad1f32..2ba7fb61 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -78,7 +78,7 @@
diff --git a/docs/articles/index.html b/docs/articles/index.html index 1152cf27..0579eeae 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -78,7 +78,7 @@ diff --git a/docs/authors.html b/docs/authors.html index 68e409ca..7ae2bb88 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -78,7 +78,7 @@ diff --git a/docs/index.html b/docs/index.html index cd8a60b0..5376e2af 100644 --- a/docs/index.html +++ b/docs/index.html @@ -42,7 +42,7 @@ diff --git a/docs/news/index.html b/docs/news/index.html index 48ad3e9b..f74cb984 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -78,7 +78,7 @@ @@ -225,11 +225,11 @@ -Last updated: 02-Sep-2019
+Last updated: 03-Sep-2019
also_single_tested
w
filter_ab_class()
to be more reliable and to support 5th generation cephalosporinsavailability()
now uses portion_R()
instead of portion_IR()
, to comply with EUCAST insightsage()
and age_groups()
now have a na.rm
parameter to remove empty valuesp.symbol()
to p_symbol()
(the former is now deprecated and will be removed in a future version)as.mo(..., allow_uncertain = 3)
Contents
as.atc(x)+
as.atc(x) + +p.symbol(...)