mirror of
https://github.com/msberends/AMR.git
synced 2025-07-09 18:22:02 +02:00
(v1.6.0.9050) printing NA in custom_eucast_rules()
This commit is contained in:
@ -23,7 +23,10 @@
|
||||
# how to conduct AMR data analysis: https://msberends.github.io/AMR/ #
|
||||
# ==================================================================== #
|
||||
|
||||
if (tryCatch(curl::has_internet(), error = function(e) FALSE)) {
|
||||
if (pkg_is_available("curl", also_load = FALSE) &&
|
||||
pkg_is_available("rvest", also_load = FALSE) &&
|
||||
pkg_is_available("xml2", also_load = FALSE) &&
|
||||
tryCatch(curl::has_internet(), error = function(e) FALSE)) {
|
||||
expect_true(length(atc_online_groups(ab_atc("AMX"))) >= 1)
|
||||
expect_equal(atc_online_ddd(ab_atc("AMX"), administration = "O"), 1.5)
|
||||
expect_equal(atc_online_ddd(ab_atc("AMX"), administration = "P"), 3)
|
||||
|
@ -35,17 +35,17 @@ expect_equal(proportion_R(example_isolates$AMX) + proportion_I(example_isolates$
|
||||
expect_equal(proportion_S(example_isolates$AMX) + proportion_I(example_isolates$AMX),
|
||||
proportion_SI(example_isolates$AMX))
|
||||
|
||||
expect_equal(example_isolates %>% proportion_SI(AMC),
|
||||
0.7626397,
|
||||
tolerance = 0.0001)
|
||||
expect_equal(example_isolates %>% proportion_SI(AMC, GEN),
|
||||
0.9408,
|
||||
tolerance = 0.0001)
|
||||
expect_equal(example_isolates %>% proportion_SI(AMC, GEN, only_all_tested = TRUE),
|
||||
0.9382647,
|
||||
tolerance = 0.0001)
|
||||
|
||||
if (pkg_is_available("dplyr")) {
|
||||
expect_equal(example_isolates %>% proportion_SI(AMC),
|
||||
0.7626397,
|
||||
tolerance = 0.0001)
|
||||
expect_equal(example_isolates %>% proportion_SI(AMC, GEN),
|
||||
0.9408,
|
||||
tolerance = 0.0001)
|
||||
expect_equal(example_isolates %>% proportion_SI(AMC, GEN, only_all_tested = TRUE),
|
||||
0.9382647,
|
||||
tolerance = 0.0001)
|
||||
|
||||
# percentages
|
||||
expect_equal(example_isolates %>%
|
||||
group_by(hospital_id) %>%
|
||||
|
Reference in New Issue
Block a user