1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-20 23:33:16 +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,17 +27,19 @@
# how to conduct AMR data analysis: https://msberends.github.io/AMR/ #
# ==================================================================== #
out1 <- top_n_microorganisms(example_isolates, n = 3)
out2 <- top_n_microorganisms(example_isolates, n = 5, property = "genus")
out3 <- top_n_microorganisms(example_isolates, n = 5, property = "genus", n_for_each = 3)
test_that("top_n_microorganisms works", {
out1 <- top_n_microorganisms(example_isolates, n = 3)
out2 <- top_n_microorganisms(example_isolates, n = 5, property = "genus")
out3 <- top_n_microorganisms(example_isolates, n = 5, property = "genus", n_for_each = 3)
expect_equal(NROW(out1), 1015, tolerance = 0.5)
expect_equal(NROW(out2), 1742, tolerance = 0.5)
expect_equal(NROW(out3), 1497, tolerance = 0.5)
expect_equal(NROW(out1), 1015, tolerance = 0.5)
expect_equal(NROW(out2), 1742, tolerance = 0.5)
expect_equal(NROW(out3), 1497, tolerance = 0.5)
expect_equal(length(table(out1$mo)), 3, tolerance = 0.5)
expect_equal(length(table(out2$mo)), 39, tolerance = 0.5)
expect_equal(length(table(out3$mo)), 13, tolerance = 0.5)
expect_equal(length(table(out1$mo)), 3, tolerance = 0.5)
expect_equal(length(table(out2$mo)), 39, tolerance = 0.5)
expect_equal(length(table(out3$mo)), 13, tolerance = 0.5)
expect_equal(length(unique(mo_genus(out2$mo))), 5, tolerance = 0.5)
expect_equal(length(unique(mo_genus(out3$mo))), 5, tolerance = 0.5)
expect_equal(length(unique(mo_genus(out2$mo))), 5, tolerance = 0.5)
expect_equal(length(unique(mo_genus(out3$mo))), 5, tolerance = 0.5)
})