1
0
mirror of https://github.com/msberends/AMR.git synced 2025-08-13 12:45:14 +02:00

new antibiotics

This commit is contained in:
2019-05-10 16:44:59 +02:00
parent 73f1ee1159
commit 68cc7ef0d0
147 changed files with 6228 additions and 4187 deletions

View File

@ -22,17 +22,17 @@
context("portion.R")
test_that("prediction of rsi works", {
amox_R <- septic_patients %>%
AMX_R <- septic_patients %>%
filter(mo == "B_ESCHR_COL") %>%
rsi_predict(col_ab = "amox",
rsi_predict(col_ab = "AMX",
col_date = "date",
minimum = 10,
info = TRUE) %>%
pull("value")
# amox resistance will increase according to data set `septic_patients`
expect_true(amox_R[3] < amox_R[20])
# AMX resistance will increase according to data set `septic_patients`
expect_true(AMX_R[3] < AMX_R[20])
x <- resistance_predict(septic_patients, col_ab = "amox", year_min = 2010)
x <- resistance_predict(septic_patients, col_ab = "AMX", year_min = 2010)
plot(x)
ggplot_rsi_predict(x)
expect_error(ggplot_rsi_predict(septic_patients))
@ -41,23 +41,23 @@ test_that("prediction of rsi works", {
expect_output(rsi_predict(tbl = filter(septic_patients, mo == "B_ESCHR_COL"),
model = "binomial",
col_ab = "amox",
col_ab = "AMX",
col_date = "date",
info = TRUE))
expect_output(rsi_predict(tbl = filter(septic_patients, mo == "B_ESCHR_COL"),
model = "loglin",
col_ab = "amox",
col_ab = "AMX",
col_date = "date",
info = TRUE))
expect_output(rsi_predict(tbl = filter(septic_patients, mo == "B_ESCHR_COL"),
model = "lin",
col_ab = "amox",
col_ab = "AMX",
col_date = "date",
info = TRUE))
expect_error(rsi_predict(tbl = filter(septic_patients, mo == "B_ESCHR_COL"),
model = "INVALID MODEL",
col_ab = "amox",
col_ab = "AMX",
col_date = "date",
info = TRUE))
expect_error(rsi_predict(tbl = filter(septic_patients, mo == "B_ESCHR_COL"),
@ -65,12 +65,12 @@ test_that("prediction of rsi works", {
col_date = "date",
info = TRUE))
expect_error(rsi_predict(tbl = filter(septic_patients, mo == "B_ESCHR_COL"),
col_ab = "amox",
col_ab = "AMX",
col_date = "NOT EXISTING COLUMN",
info = TRUE))
# almost all E. coli are mero S in the Netherlands :)
# almost all E. coli are MEM S in the Netherlands :)
expect_error(resistance_predict(tbl = filter(septic_patients, mo == "B_ESCHR_COL"),
col_ab = "mero",
col_ab = "MEM",
col_date = "date",
info = TRUE))