1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-10 12:21:53 +02:00

Replace RSI with SIR

This commit is contained in:
Dr. Matthijs Berends
2023-01-21 23:47:20 +01:00
committed by GitHub
parent 24b12024ce
commit 98e62c9af2
127 changed files with 1746 additions and 1648 deletions

View File

@ -41,7 +41,7 @@
#' if (require("dplyr")) {
#' example_isolates %>%
#' filter(mo == as.mo("Escherichia coli")) %>%
#' select_if(is.rsi) %>%
#' select_if(is.sir) %>%
#' availability()
#' }
#' }
@ -55,7 +55,7 @@ availability <- function(tbl, width = NULL) {
1 - sum(is.na(x)) / length(x)
})
n <- vapply(FUN.VALUE = double(1), tbl, function(x) length(x[!is.na(x)]))
R <- vapply(FUN.VALUE = double(1), tbl, function(x) ifelse(is.rsi(x), resistance(x, minimum = 0), NA_real_))
R <- vapply(FUN.VALUE = double(1), tbl, function(x) ifelse(is.sir(x), resistance(x, minimum = 0), NA_real_))
R_print <- character(length(R))
R_print[!is.na(R)] <- percentage(R[!is.na(R)])
R_print[is.na(R)] <- ""