Added function n_rsi

This commit is contained in:
dr. M.S. (Matthijs) Berends committed 2018-05-02 14:56:25 +02:00
1 parent e5ae7b98ac
commit c0fc82c794
17 files changed
+292 -171

No files matched your search

+2
View File
@@ -1,6 +1,8 @@
context("eucast.R")
test_that("EUCAST rules work", {
a <- EUCAST_rules(septic_patients)
a <- data.frame(bactid = c("KLEPNE", # Klebsiella pneumoniae
"PSEAER", # Pseudomonas aeruginosa
"ENTAER"), # Enterobacter aerogenes
+15
View File
@@ -29,6 +29,21 @@ test_that("rsi works", {
info = FALSE),
0.9858,
tolerance = 0.0001)
# count of cases
expect_equal(septic_patients %>%
group_by(hospital_id) %>%
summarise(cipro_S = rsi(cipr, interpretation = "S",
as_percent = TRUE, warning = FALSE),
cipro_n = n_rsi(cipr),
genta_S = rsi(gent, interpretation = "S",
as_percent = TRUE, warning = FALSE),
genta_n = n_rsi(gent),
combination_S = rsi(cipr, gent, interpretation = "S",
as_percent = TRUE, warning = FALSE),
combination_n = n_rsi(cipr, gent)) %>%
pull(combination_n),
c(138, 474, 170, 464, 183))
})
test_that("prediction of rsi works", {