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

improvement for forecasting resistance

This commit is contained in:
2018-07-26 16:30:42 +02:00
parent d9e204031d
commit 498e88b5cf
13 changed files with 438 additions and 145 deletions

View File

@ -11,10 +11,9 @@ test_that("EUCAST rules work", {
amox = "-", # Amoxicillin
stringsAsFactors = FALSE)
b <- data.frame(bactid =
as.bactid(
c("KLEPNE", # Klebsiella pneumoniae
"PSEAER", # Pseudomonas aeruginosa
"ENTAER")), # Enterobacter aerogenes
c("KLEPNE", # Klebsiella pneumoniae
"PSEAER", # Pseudomonas aeruginosa
"ENTAER"), # Enterobacter aerogenes
amox = "R", # Amoxicillin
stringsAsFactors = FALSE)
expect_identical(EUCAST_rules(a, info = FALSE), b)
@ -26,9 +25,8 @@ test_that("EUCAST rules work", {
coli = "-", # Colistin
stringsAsFactors = FALSE)
b <- data.frame(bactid =
as.bactid(
c("STAAUR", # Staphylococcus aureus
"STCGRA")), # Streptococcus pyognenes (Lancefield Group A)
c("STAAUR", # Staphylococcus aureus
"STCGRA"), # Streptococcus pyognenes (Lancefield Group A)
coli = "R", # Colistin
stringsAsFactors = FALSE)
expect_equal(EUCAST_rules(a, info = FALSE), b)

View File

@ -84,8 +84,9 @@ test_that("prediction of rsi works", {
filter(bactid == "ESCCOL") %>%
rsi_predict(col_ab = "amox",
col_date = "date",
minimum = 10,
info = TRUE) %>%
pull("probR")
pull("resistance")
# amox resistance will increase according to data set `septic_patients`
expect_true(amox_R[3] < amox_R[20])