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

(v2.1.1.9218) Fix unit tests

This commit is contained in:
2025-03-19 16:05:24 +01:00
parent 4dc4398ad1
commit 287e361a54
17 changed files with 385 additions and 385 deletions

View File

@ -565,7 +565,7 @@ antibiogram.default <- function(x,
# make list unique
antimicrobials <- unique(user_ab)
# go through list to set AMR in combinations
for (i in seq_len(length(antimicrobials))) {
for (i in seq_along(antimicrobials)) {
abx <- antimicrobials[[i]]
for (ab in abx) {
# make sure they are SIR columns
@ -896,7 +896,7 @@ antibiogram.default <- function(x,
ab_naming_function <- function(x, t, l, s) {
x <- strsplit(x, s, fixed = TRUE)
out <- character(length = length(x))
for (i in seq_len(length(x))) {
for (i in seq_along(x)) {
a <- x[[i]]
if (is.null(t)) {
# leave as is
@ -941,7 +941,7 @@ antibiogram.default <- function(x,
if (isTRUE(has_syndromic_group)) {
grps <- unique(out$syndromic_group)
for (i in seq_len(length(grps))) {
for (i in seq_along(grps)) {
grp <- grps[i]
if (i == 1) {
new_df <- long_to_wide(out[which(out$syndromic_group == grp), , drop = FALSE])

View File

@ -812,7 +812,7 @@ as.sir.data.frame <- function(x,
x_mo <- as.mo(x[, col_mo, drop = TRUE])
}
for (i in seq_len(length(ab_cols))) {
for (i in seq_along(ab_cols)) {
if (types[i] == "mic") {
x[, ab_cols[i]] <- x %pm>%
pm_pull(ab_cols[i]) %pm>%
@ -1621,7 +1621,7 @@ as_sir_method <- function(method_short,
}
notes <- unique(notes)
if (isTRUE(verbose) || length(notes) == 1 || NROW(AMR_env$sir_interpretation_history) == 0) {
for (i in seq_len(length(notes))) {
for (i in seq_along(notes)) {
message(word_wrap(" ", AMR_env$bullet_icon, " ", notes[i], add_fn = font_black))
}
} else {

Binary file not shown.