1
0
mirror of https://github.com/msberends/AMR.git synced 2025-09-06 04:09:39 +02:00

(v2.1.1.9186) replace antibiotics with antimicrobials!

This commit is contained in:
2025-03-07 20:43:26 +01:00
parent f2b2a450cb
commit f7938289eb
140 changed files with 4870 additions and 4702 deletions

View File

@@ -27,31 +27,33 @@
# how to conduct AMR data analysis: https://msberends.github.io/AMR/ #
# ==================================================================== #
# extra tests for {vctrs} pkg support
if (AMR:::pkg_is_available("tibble")) {
test <- tibble::tibble(
ab = as.ab("CIP"),
mo = as.mo("Escherichia coli"),
mic = as.mic(2),
disk = as.disk(20),
sir = as.sir("S")
)
check1 <- lapply(test, class)
test[1, "ab"] <- "GEN"
test[1, "mo"] <- "B_KLBSL_PNMN"
test[1, "mic"] <- ">=32"
test[1, "mic"] <- 32
test[1, "disk"] <- "35"
test[1, "disk"] <- 25
test[1, "disk"] <- 26L
test[1, "sir"] <- "R"
check2 <- lapply(test, class)
expect_identical(check1, check2)
test_that("vctrs works", {
# extra tests for {vctrs} pkg support
if (AMR:::pkg_is_available("tibble")) {
test <- tibble::tibble(
ab = as.ab("CIP"),
mo = as.mo("Escherichia coli"),
mic = as.mic(2),
disk = as.disk(20),
sir = as.sir("S")
)
check1 <- lapply(test, class)
test[1, "ab"] <- "GEN"
test[1, "mo"] <- "B_KLBSL_PNMN"
test[1, "mic"] <- ">=32"
test[1, "mic"] <- 32
test[1, "disk"] <- "35"
test[1, "disk"] <- 25
test[1, "disk"] <- 26L
test[1, "sir"] <- "R"
check2 <- lapply(test, class)
expect_identical(check1, check2)
test <- tibble::tibble(
cipro = as.sir("S"),
variable = "test"
)
expect_equal(nrow(test[quinolones() == "S", ]), 1)
expect_equal(nrow(test[quinolones() == "R", ]), 0)
}
test <- tibble::tibble(
cipro = as.sir("S"),
variable = "test"
)
expect_equal(nrow(test[quinolones() == "S", ]), 1)
expect_equal(nrow(test[quinolones() == "R", ]), 0)
}
})