mirror of
https://github.com/msberends/AMR.git
synced 2025-07-08 11:51:59 +02:00
renamed year columns to ref
This commit is contained in:
@ -112,5 +112,19 @@ test_that("frequency table works", {
|
||||
expect_error(septic_patients %>% freq(peni, oxac, clox, amox, amcl,
|
||||
ampi, pita, czol, cfep, cfur))
|
||||
|
||||
# run diff
|
||||
expect_output(print(
|
||||
diff(freq(septic_patients$amcl),
|
||||
freq(septic_patients$amox))
|
||||
))
|
||||
expect_output(print(
|
||||
diff(freq(septic_patients$age),
|
||||
freq(septic_patients$age)) # same
|
||||
))
|
||||
expect_error(print(
|
||||
diff(freq(septic_patients$amcl),
|
||||
"Just a string") # not a freq tbl
|
||||
))
|
||||
|
||||
})
|
||||
|
||||
|
@ -158,4 +158,14 @@ test_that("as.mo works", {
|
||||
expect_equal(suppressWarnings(as.character(as.mo("esco extra_text", allow_uncertain = TRUE))), "B_ESCHR_COL")
|
||||
expect_warning(as.mo("esco extra_text", allow_uncertain = TRUE))
|
||||
|
||||
# predefined reference_df
|
||||
expect_equal(as.character(as.mo("TestingOwnID",
|
||||
reference_df = data.frame(a = "TestingOwnID", b = "B_ESCHR_COL"))),
|
||||
"B_ESCHR_COL")
|
||||
expect_equal(as.character(as.mo(c("TestingOwnID", "E. coli"),
|
||||
reference_df = data.frame(a = "TestingOwnID", b = "B_ESCHR_COL"))),
|
||||
c("B_ESCHR_COL", "B_ESCHR_COL"))
|
||||
expect_warning(as.character(as.mo("TestingOwnID",
|
||||
reference_df = NULL)))
|
||||
|
||||
})
|
||||
|
@ -15,8 +15,8 @@ test_that("mo_property works", {
|
||||
expect_equal(class(mo_taxonomy("E. coli")), "list")
|
||||
expect_equal(names(mo_taxonomy("E. coli")), c("subkingdom", "phylum", "class", "order",
|
||||
"family", "genus", "species", "subspecies"))
|
||||
expect_equal(mo_authors("E. coli"), "Castellani and Chalmers")
|
||||
expect_equal(mo_year("E. coli"), 1919)
|
||||
|
||||
expect_equal(mo_ref("E. coli"), "Castellani and Chalmers, 1919")
|
||||
|
||||
expect_equal(mo_shortname("MRSA"), "S. aureus")
|
||||
expect_equal(mo_shortname("MRSA", Becker = TRUE), "S. aureus")
|
||||
|
Reference in New Issue
Block a user