1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-12 21:01:56 +02:00

(v1.6.0.9041) filter_ab_class() fix

This commit is contained in:
2021-05-16 10:50:00 +02:00
parent 00496e45b7
commit 916df6e90c
41 changed files with 142 additions and 133 deletions

View File

@ -110,7 +110,7 @@ expect_error(first_isolate(example_isolates,
col_date = "non-existing col",
col_mo = "mo"))
if (suppressWarnings(require("dplyr"))) {
if (pkg_is_available("dplyr")) {
# if mo is not an mo class, result should be the same
expect_identical(example_isolates %>%
mutate(mo = as.character(mo)) %>%
@ -174,9 +174,7 @@ expect_identical(filter_first_isolate(example_isolates),
# notice that all mo's are distinct, so all are TRUE
expect_true(all(example_isolates %pm>%
pm_distinct(mo, .keep_all = TRUE) %pm>%
first_isolate(info = TRUE) == TRUE))
expect_true(all(first_isolate(AMR:::pm_distinct(example_isolates, mo, .keep_all = TRUE), info = TRUE) == TRUE))
# only one isolate, so return fast
expect_true(first_isolate(data.frame(mo = "Escherichia coli", date = Sys.Date(), patient = "patient"), info = TRUE))