1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-08 16:42:10 +02:00

(v0.7.1.9031) include_unknown for first_isolate()

This commit is contained in:
2019-08-08 22:39:42 +02:00
parent 22a206ffd8
commit 1ce4b72dd2
17 changed files with 173 additions and 164 deletions

View File

@ -187,5 +187,25 @@ test_that("first isolates work", {
info = TRUE),
na.rm = TRUE),
1322)
# unknown MOs
expect_equal(septic_patients %>%
mutate(mo = ifelse(mo == "B_ESCHR_COL", "UNKNOWN", mo)) %>%
mutate(first = first_isolate(., include_unknown = FALSE)) %>%
.$first %>%
sum(),
1062)
expect_equal(septic_patients %>%
mutate(mo = ifelse(mo == "B_ESCHR_COL", "UNKNOWN", mo)) %>%
mutate(first = first_isolate(., include_unknown = TRUE)) %>%
.$first %>%
sum(),
1529)
expect_equal(septic_patients %>%
mutate(mo = ifelse(mo == "B_ESCHR_COL", NA, mo)) %>%
mutate(first = first_isolate(.)) %>%
.$first %>%
sum(),
1062)
})