mirror of
https://github.com/msberends/AMR.git
synced 2025-07-08 23:21:56 +02:00
(v1.3.0.9027) unit tests
This commit is contained in:
@ -43,7 +43,7 @@ test_that("ab_property works", {
|
||||
|
||||
expect_identical(ab_ddd("AMX", "oral"), 1.5)
|
||||
expect_identical(ab_ddd("AMX", "oral", units = TRUE), "g")
|
||||
expect_identical(ab_ddd("AMX", "iv"), 1)
|
||||
expect_identical(ab_ddd("AMX", "iv"), 3)
|
||||
expect_identical(ab_ddd("AMX", "iv", units = TRUE), "g")
|
||||
|
||||
expect_identical(ab_name(x = c("AMC", "PLB"), language = NULL), c("Amoxicillin/clavulanic acid", "Polymyxin B"))
|
||||
|
@ -29,7 +29,7 @@ test_that("counts work", {
|
||||
expect_equal(count_all(example_isolates$AMX), n_rsi(example_isolates$AMX))
|
||||
|
||||
# AMX resistance in `example_isolates`
|
||||
expect_equal(count_R(example_isolates$AMX), 683)
|
||||
expect_equal(count_R(example_isolates$AMX), 804)
|
||||
expect_equal(count_I(example_isolates$AMX), 3)
|
||||
expect_equal(suppressWarnings(count_S(example_isolates$AMX)), 543)
|
||||
expect_equal(count_R(example_isolates$AMX) + count_I(example_isolates$AMX),
|
||||
|
@ -74,7 +74,7 @@ test_that("first isolates work", {
|
||||
type = "points",
|
||||
info = TRUE),
|
||||
na.rm = TRUE)),
|
||||
1400)
|
||||
1399)
|
||||
|
||||
# first non-ICU isolates
|
||||
expect_equal(
|
||||
|
@ -29,8 +29,8 @@ test_that("proportions works", {
|
||||
expect_equal(proportion_SI(example_isolates$AMX), susceptibility(example_isolates$AMX))
|
||||
|
||||
# AMX resistance in `example_isolates`
|
||||
expect_equal(proportion_R(example_isolates$AMX), 0.5557364, tolerance = 0.0001)
|
||||
expect_equal(proportion_I(example_isolates$AMX), 0.002441009, tolerance = 0.0001)
|
||||
expect_equal(proportion_R(example_isolates$AMX), 0.5955556, tolerance = 0.0001)
|
||||
expect_equal(proportion_I(example_isolates$AMX), 0.002222222, tolerance = 0.0001)
|
||||
expect_equal(1 - proportion_R(example_isolates$AMX) - proportion_I(example_isolates$AMX),
|
||||
proportion_S(example_isolates$AMX))
|
||||
expect_equal(proportion_R(example_isolates$AMX) + proportion_I(example_isolates$AMX),
|
||||
|
Reference in New Issue
Block a user