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

(v1.4.0.9046) get_episode

This commit is contained in:
2020-12-27 00:07:00 +01:00
parent 291f802be3
commit acbd0cf7ca
99 changed files with 1143 additions and 683 deletions

View File

@ -79,7 +79,9 @@ test_that("counts work", {
)
# warning for speed loss
reset_all_thrown_messages()
expect_warning(count_resistant(as.character(example_isolates$AMC)))
reset_all_thrown_messages()
expect_warning(count_resistant(example_isolates$AMC,
as.character(example_isolates$GEN)))

View File

@ -23,7 +23,7 @@
# how to conduct AMR analysis: https://msberends.github.io/AMR/ #
# ==================================================================== #
context("is_new_episode.R")
context("episode.R")
test_that("new episodes work", {
skip_on_cran()

View File

@ -28,6 +28,7 @@ context("filter_ab_class.R")
test_that("ATC-group filtering works", {
skip_on_cran()
library(dplyr)
expect_gt(example_isolates %>% filter_ab_class("carbapenem") %>% nrow(), 0)
expect_gt(example_isolates %>% filter_aminoglycosides() %>% nrow(), 0)
expect_gt(example_isolates %>% filter_carbapenems() %>% nrow(), 0)

View File

@ -76,11 +76,15 @@ test_that("proportions works", {
combination_n = n_rsi(CIP, GEN)) %>%
pull(combination_n),
c(305, 617, 241, 711))
reset_all_thrown_messages()
expect_warning(proportion_R(as.character(example_isolates$AMC)))
reset_all_thrown_messages()
expect_warning(proportion_S(as.character(example_isolates$AMC)))
reset_all_thrown_messages()
expect_warning(proportion_S(as.character(example_isolates$AMC,
example_isolates$GEN)))
reset_all_thrown_messages()
expect_warning(n_rsi(as.character(example_isolates$AMC,
example_isolates$GEN)))
expect_equal(suppressWarnings(n_rsi(as.character(example_isolates$AMC,
@ -105,8 +109,11 @@ test_that("proportions works", {
NA_real_)
# warning for speed loss
reset_all_thrown_messages()
expect_warning(proportion_R(as.character(example_isolates$GEN)))
reset_all_thrown_messages()
expect_warning(proportion_I(as.character(example_isolates$GEN)))
reset_all_thrown_messages()
expect_warning(proportion_S(example_isolates$AMC, as.character(example_isolates$GEN)))
# proportion_df