mirror of
https://github.com/msberends/AMR.git
synced 2025-07-08 23:21:56 +02:00
(v0.7.1.9027) tibble printing
This commit is contained in:
@ -34,6 +34,8 @@ test_that("EUCAST rules work", {
|
||||
expect_error(eucast_rules(x = "text"))
|
||||
expect_error(eucast_rules(data.frame(a = "test")))
|
||||
expect_error(eucast_rules(data.frame(mo = "test"), rules = "invalid rules set"))
|
||||
|
||||
expect_warning(eucast_rules(data.frame(mo = "Escherichia coli", vancomycin = "S")))
|
||||
|
||||
expect_identical(colnames(septic_patients),
|
||||
colnames(suppressWarnings(eucast_rules(septic_patients))))
|
||||
|
@ -115,6 +115,7 @@ test_that("portions works", {
|
||||
septic_patients$AMX %>% portion_I(),
|
||||
septic_patients$AMX %>% portion_R())
|
||||
)
|
||||
|
||||
|
||||
|
||||
expect_error(portion_df(c("A", "B", "C")))
|
||||
expect_error(portion_df(septic_patients[,"date"]))
|
||||
})
|
||||
|
@ -32,7 +32,7 @@ test_that("prediction of rsi works", {
|
||||
# # 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 = "AMX", year_min = 2010)
|
||||
x <- resistance_predict(septic_patients, col_ab = "AMX", year_min = 2010, model = "binomial")
|
||||
plot(x)
|
||||
ggplot_rsi_predict(x)
|
||||
expect_error(ggplot_rsi_predict(septic_patients))
|
||||
@ -61,19 +61,27 @@ test_that("prediction of rsi works", {
|
||||
col_date = "date",
|
||||
info = TRUE))
|
||||
expect_error(rsi_predict(x = filter(septic_patients, mo == "B_ESCHR_COL"),
|
||||
model = "binomial",
|
||||
col_ab = "NOT EXISTING COLUMN",
|
||||
col_date = "date",
|
||||
info = TRUE))
|
||||
expect_error(rsi_predict(x = filter(septic_patients, mo == "B_ESCHR_COL"),
|
||||
model = "binomial",
|
||||
col_ab = "AMX",
|
||||
col_date = "NOT EXISTING COLUMN",
|
||||
info = TRUE))
|
||||
expect_error(rsi_predict(x = filter(septic_patients, mo == "B_ESCHR_COL"),
|
||||
col_ab = "AMX",
|
||||
col_date = "NOT EXISTING COLUMN",
|
||||
info = TRUE))
|
||||
expect_error(rsi_predict(x = filter(septic_patients, mo == "B_ESCHR_COL"),
|
||||
col_ab = "AMX",
|
||||
col_date = "date",
|
||||
info = TRUE))
|
||||
# almost all E. coli are MEM S in the Netherlands :)
|
||||
expect_error(resistance_predict(x = filter(septic_patients, mo == "B_ESCHR_COL"),
|
||||
model = "binomial",
|
||||
col_ab = "MEM",
|
||||
col_date = "date",
|
||||
info = TRUE))
|
||||
|
||||
expect_error(portion_df(c("A", "B", "C")))
|
||||
expect_error(portion_df(septic_patients[,"date"]))
|
||||
})
|
||||
|
Reference in New Issue
Block a user