1
0
mirror of https://github.com/msberends/AMR.git synced 2024-12-25 19:26:13 +01:00

small fix

This commit is contained in:
dr. M.S. (Matthijs) Berends 2018-11-05 15:36:07 +01:00
parent d15bb2ab3f
commit ee664f2a4c
2 changed files with 3 additions and 3 deletions

View File

@ -155,12 +155,12 @@ first_isolate <- function(tbl,
col_mo <- col_bactid
warning("Use of `col_bactid` is deprecated. Use `col_mo` instead.")
} else if (is.null(col_mo) & "mo" %in% lapply(tbl, class)) {
col_mo <- colnames(tbl)[lapply(tbl, class) == "mo"]
col_mo <- colnames(tbl)[lapply(tbl, class) == "mo"][1]
message("NOTE: Using column `", col_mo, "` as input for `col_mo`.")
}
# -- date
if (is.null(col_date) & "Date" %in% lapply(tbl, class)) {
col_date <- colnames(tbl)[lapply(tbl, class) == "Date"]
col_date <- colnames(tbl)[lapply(tbl, class) == "Date"][1]
message("NOTE: Using column `", col_date, "` as input for `col_date`.")
}
# -- patient id

View File

@ -114,7 +114,7 @@ MDRO <- function(tbl,
col_mo <- col_bactid
warning("Use of `col_bactid` is deprecated. Use `col_mo` instead.")
} else if (is.null(col_mo) & "mo" %in% lapply(tbl, class)) {
col_mo <- colnames(tbl)[lapply(tbl, class) == "mo"]
col_mo <- colnames(tbl)[lapply(tbl, class) == "mo"][1]
message("NOTE: Using column `", col_mo, "` as input for `col_mo`.")
} else if (!col_mo %in% colnames(tbl)) {
stop('Column ', col_mo, ' not found.', call. = FALSE)