mirror of
https://github.com/msberends/AMR.git
synced 2025-07-08 16:02:02 +02:00
(v1.7.1.9056) unit tests
This commit is contained in:
@ -35,6 +35,10 @@ test_df <- rbind(
|
||||
|
||||
expect_equal(get_episode(test_df$date, 365),
|
||||
c(1, 1, 2, 2, 2, 3, 3, 4, 1, 2, 2, 2, 3))
|
||||
expect_equal(get_episode(test_df$date[which(test_df$patient_id == "A")], 365),
|
||||
c(1, 1, 2, 2, 2, 2, 3, 4))
|
||||
expect_equal(get_episode(test_df$date[which(test_df$patient_id == "B")], 365),
|
||||
c(1, 2, 2, 2, 3))
|
||||
|
||||
if (AMR:::pkg_is_available("dplyr", min_version = "1.0.0")) {
|
||||
expect_identical(test_df %>% group_by(patient_id) %>% mutate(f = is_new_episode(date, 365)) %>% pull(f),
|
||||
|
@ -40,7 +40,7 @@ expect_identical(class(outcome), c("ordered", "factor"))
|
||||
|
||||
# example_isolates should have these finding using Dutch guidelines
|
||||
expect_equal(as.double(table(outcome)),
|
||||
c(1970, 24, 6)) # 1970 neg, 24 unconfirmed, 6 pos
|
||||
c(1954, 24, 6)) # 1954 neg, 24 unconfirmed, 6 pos, rest is NA
|
||||
|
||||
expect_equal(brmo(example_isolates, info = FALSE),
|
||||
mdro(example_isolates, guideline = "BRMO", info = FALSE))
|
||||
|
Reference in New Issue
Block a user