mirror of
https://github.com/msberends/AMR.git
synced 2025-07-10 19:41:55 +02:00
(v2.1.1.9187) WISCA fix
This commit is contained in:
@ -606,9 +606,6 @@ antibiogram.default <- function(x,
|
||||
warning_("All combinations had less than `minimum = ", minimum, "` results, returning an empty antibiogram")
|
||||
return(as_original_data_class(data.frame(), class(x), extra_class = "antibiogram"))
|
||||
} else if (any(out$n_tested < minimum, na.rm = TRUE)) {
|
||||
out <- out %pm>%
|
||||
# also for WISCA, refrain from anything below 15 isolates:
|
||||
subset(n_tested > 15)
|
||||
mins <- sum(out$n_tested < minimum, na.rm = TRUE)
|
||||
if (wisca == FALSE) {
|
||||
out <- out %pm>%
|
||||
@ -620,7 +617,6 @@ antibiogram.default <- function(x,
|
||||
warning_("Number of tested isolates per regimen should exceed ", minimum, " for each species. Coverage estimates might be inaccurate.", call = FALSE)
|
||||
}
|
||||
}
|
||||
|
||||
if (NROW(out) == 0) {
|
||||
return(as_original_data_class(data.frame(), class(x), extra_class = "antibiogram"))
|
||||
}
|
||||
@ -671,6 +667,7 @@ antibiogram.default <- function(x,
|
||||
out_wisca <- out %pm>%
|
||||
pm_group_by(ab)
|
||||
}
|
||||
|
||||
out_wisca <- out_wisca %pm>%
|
||||
pm_summarise(
|
||||
coverage = NA_real_,
|
||||
@ -680,6 +677,7 @@ antibiogram.default <- function(x,
|
||||
n_tested = sum(n_tested, na.rm = TRUE),
|
||||
n_susceptible = sum(n_susceptible, na.rm = TRUE)
|
||||
)
|
||||
|
||||
out_wisca$p_susceptible <- out_wisca$n_susceptible / out_wisca$n_tested
|
||||
|
||||
if (isTRUE(has_syndromic_group)) {
|
||||
|
1
R/data.R
1
R/data.R
@ -74,7 +74,6 @@
|
||||
#' * European Commission Public Health PHARMACEUTICALS - COMMUNITY REGISTER: <https://ec.europa.eu/health/documents/community-register/html/reg_hum_atc.htm>
|
||||
#' @inheritSection WHOCC WHOCC
|
||||
#' @seealso [microorganisms], [intrinsic_resistant]
|
||||
#' @aliases antibiotics
|
||||
#' @examples
|
||||
#' antimicrobials
|
||||
#' antivirals
|
||||
|
@ -1 +0,0 @@
|
||||
test_that("key_antimicrobials works", {
|
@ -36,6 +36,7 @@
|
||||
NULL
|
||||
|
||||
#' @rdname AMR-deprecated
|
||||
#' @usage NULL
|
||||
#' @export
|
||||
"antibiotics"
|
||||
|
||||
|
4
R/zzz.R
4
R/zzz.R
@ -210,7 +210,9 @@ AMR_env$cross_icon <- if (isTRUE(base::l10n_info()$`UTF-8`)) "\u00d7" else "x"
|
||||
|
||||
# deprecated antibiotics data set
|
||||
makeActiveBinding("antibiotics", function() {
|
||||
deprecation_warning(old = "antibiotics", new = "antimicrobials", is_function = FALSE, is_dataset = TRUE)
|
||||
if (interactive()) {
|
||||
deprecation_warning(old = "antibiotics", new = "antimicrobials", is_function = FALSE, is_dataset = TRUE)
|
||||
}
|
||||
AMR::antimicrobials
|
||||
}, env = asNamespace(pkgname))
|
||||
|
||||
|
Reference in New Issue
Block a user