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:
@ -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)
|
||||
|
@ -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])
|
||||
|
||||
|
Reference in New Issue
Block a user