mirror of
https://github.com/msberends/AMR.git
synced 2026-11-16 03:40:48 +01:00
(v3.0.1.9137) Add the guideline argument to count_df(), proportion_df(), sir_df(), ggplot_sir(), geom_sir(), and labels_sir_count(), so that with CLSI the 'I' category is merged with R, and describe in the documentation of get_AMR_locale() that LANG takes precedence over LANGUAGE
This commit is contained in:
1 parent
46f5de1d36
commit
dbd95ffa46
17 files changed
+118
-40
No files matched your search
@@ -89,14 +89,28 @@ test_that("test-count.R", {
|
||||
c(946, 428, 94)
|
||||
)
|
||||
|
||||
# count_df, which always combines S and I, as with EUCAST
|
||||
# count_df, which combines 'I' with S for EUCAST and with R for CLSI
|
||||
expect_equal(
|
||||
example_isolates %>% select(AMX) %>% count_df() %>% pull(value),
|
||||
example_isolates %>% select(AMX) %>% count_df(guideline = "EUCAST") %>% pull(value),
|
||||
c(
|
||||
example_isolates$AMX %>% count_susceptible(guideline = "EUCAST"),
|
||||
example_isolates$AMX %>% count_resistant(guideline = "EUCAST")
|
||||
)
|
||||
)
|
||||
expect_equal(
|
||||
example_isolates %>% select(AMX) %>% count_df(guideline = "CLSI") %>% pull(value),
|
||||
c(
|
||||
example_isolates$AMX %>% count_susceptible(guideline = "CLSI"),
|
||||
example_isolates$AMX %>% count_resistant(guideline = "CLSI")
|
||||
)
|
||||
)
|
||||
expect_identical(
|
||||
levels(count_df(example_isolates[, "AMX"], guideline = "CLSI")$interpretation),
|
||||
c("S", "IR")
|
||||
)
|
||||
old_opts <- options(AMR_guideline = "CLSI")
|
||||
expect_identical(count_df(example_isolates[, "AMX"]), count_df(example_isolates[, "AMX"], guideline = "CLSI"))
|
||||
options(old_opts)
|
||||
expect_equal(
|
||||
example_isolates %>% select(AMX) %>% count_df(combine_SI = FALSE) %>% pull(value),
|
||||
c(
|
||||
|
||||
Reference in new issue
Block a user