mirror of
https://github.com/msberends/AMR.git
synced 2025-07-10 06:21:50 +02:00
(v2.1.1.9220) unit test
This commit is contained in:
2
R/ab.R
2
R/ab.R
@ -358,7 +358,7 @@ as.ab <- function(x, flag_multiple_results = TRUE, language = get_AMR_locale(),
|
||||
FUN.VALUE = double(1),
|
||||
ab_df$generalised_synonyms,
|
||||
function(y) {
|
||||
ifelse(length(y[nchar(y) >= 5]) == 0,
|
||||
ifelse(all(is.na(y)) || length(y[nchar(y) >= 5]) == 0,
|
||||
999,
|
||||
min(as.double(utils::adist(x[i], y[nchar(y) >= 5],
|
||||
ignore.case = FALSE,
|
||||
|
@ -955,7 +955,7 @@ any.amr_selector_any_all <- function(..., na.rm = FALSE) {
|
||||
`+.amr_selector` <- function(e1, e2) {
|
||||
# this is useful for `antibiogram()`: antibiogram(example_isolates, carbapenems() + c("", "GEN", "TOB"))
|
||||
structure(as.character(outer(e1, e2, paste, sep = " + ")),
|
||||
class = c("amr_selector", "character")
|
||||
class = c("amr_selector", "character")
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -336,7 +336,7 @@
|
||||
#' antimicrobials = c("TZP", "TZP+TOB", "TZP+GEN"),
|
||||
#' mo_transform = "gramstain"
|
||||
#' )
|
||||
#'
|
||||
#'
|
||||
#' # you can use any antimicrobial selector with `+` too:
|
||||
#' antibiogram(example_isolates,
|
||||
#' antimicrobials = ureidopenicillins() + c("", "GEN", "tobra"),
|
||||
|
Reference in New Issue
Block a user