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

speed improvement is.rsi.eligible

This commit is contained in:
2018-11-02 14:55:29 +01:00
parent 40a159e78d
commit d0bc05e5b1
4 changed files with 57 additions and 17 deletions

View File

@ -19,4 +19,17 @@ test_that("rsi works", {
"Sum IR" = "1",
"-Sum R" = "1",
"-Sum I" = "0"))
expect_identical(as.logical(lapply(septic_patients, is.rsi.eligible)),
rep(FALSE, length(septic_patients)))
library(dplyr)
# 40 rsi columns
expect_identical(septic_patients %>%
mutate_at(vars(peni:rifa), as.character) %>%
lapply(is.rsi.eligible) %>%
as.logical() %>%
sum(),
40)
})