mirror of
https://github.com/msberends/AMR.git
synced 2025-07-09 17:41:59 +02:00
fix for as.mo and freq
This commit is contained in:
@ -73,6 +73,10 @@ test_that("EUCAST rules work", {
|
||||
, info = FALSE))$amox,
|
||||
"S")
|
||||
|
||||
# also test norf
|
||||
expect_output(suppressWarnings(eucast_rules(septic_patients %>% mutate(norf = "S", nali = "S"))))
|
||||
|
||||
# check verbose output
|
||||
expect_output(suppressWarnings(eucast_rules(septic_patients, verbose = TRUE)))
|
||||
|
||||
})
|
||||
|
@ -77,6 +77,9 @@ test_that("as.mo works", {
|
||||
# too few characters
|
||||
expect_warning(as.mo("ab"))
|
||||
|
||||
expect_equal(suppressWarnings(as.character(as.mo(c("Qq species", "", "CRS", "K. pneu rhino", "esco")))),
|
||||
c(NA_character_, NA_character_, "B_STNTR_MAL", "B_KLBSL_PNE_RHI", "B_ESCHR_COL"))
|
||||
|
||||
# check for Becker classification
|
||||
expect_identical(as.character(guess_mo("S. epidermidis", Becker = FALSE)), "B_STPHY_EPI")
|
||||
expect_identical(as.character(guess_mo("S. epidermidis", Becker = TRUE)), "B_STPHY_CNS")
|
||||
@ -202,4 +205,9 @@ test_that("as.mo works", {
|
||||
"E. species")),
|
||||
rep("Escherichia species", 3))
|
||||
|
||||
# from different sources
|
||||
expect_equal(as.character(as.mo(
|
||||
c("PRTMIR", "bclcer", "B_ESCHR_COL"))),
|
||||
c("B_PROTS_MIR", "B_BCLLS_CER", "B_ESCHR_COL"))
|
||||
|
||||
})
|
||||
|
Reference in New Issue
Block a user