1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-09 06:51:48 +02:00

(v0.7.1.9079) small fixes

This commit is contained in:
2019-09-22 12:41:45 +02:00
parent 46b61e9a70
commit 57b0bd92a0
26 changed files with 302 additions and 297 deletions

View File

@ -29,6 +29,7 @@ clean::freq
#' @export
#' @noRd
freq.mo <- function(x, ...) {
x <- as.mo(x) # to get the newest mo codes
x_noNA <- x[!is.na(x)]
grams <- mo_gramstain(x_noNA, language = NULL)
freq.default(x = x, ...,

View File

@ -46,6 +46,7 @@ globalVariables(c(".",
"key_ab_lag",
"key_ab_other",
"kingdom",
"kingdom_index",
"lang",
"Last name",
"lookup",

2
R/mo.R
View File

@ -1721,7 +1721,7 @@ exec_as.mo <- function(x,
print(mo_renamed())
}
if (old_mo_warning == TRUE) {
if (old_mo_warning == TRUE & property != "mo") {
warning("The input contained old microorganism IDs from previous versions of this package. Please use as.mo() on these old codes.\nSUPPORT FOR THIS WILL BE DROPPED IN A FUTURE VERSION.", call. = FALSE)
}

View File

@ -29,6 +29,7 @@ set_mo_history <- function(x, mo, uncertainty_level, force = FALSE, disable = FA
if (base::interactive() | force == TRUE) {
mo_hist <- read_mo_history(uncertainty_level = uncertainty_level, force = force)
warning_new_write <- FALSE
df <- data.frame(x, mo, stringsAsFactors = FALSE) %>%
distinct(x, .keep_all = TRUE) %>%
filter(!is.na(x) & !is.na(mo))
@ -55,8 +56,9 @@ set_mo_history <- function(x, mo, uncertainty_level, force = FALSE, disable = FA
# if (tryCatch(nrow(getOption("mo_remembered_results")), error = function(e) 1001) > 1000) {
# return(base::invisible())
# }
if (is.null(mo_hist) & interactive()) {
if (is.null(mo_hist) & interactive() & warning_new_write == FALSE) {
message(blue(paste0("NOTE: results are saved to ", mo_history_file(), ".")))
warning_new_write <- TRUE
}
tryCatch(write.csv(rbind(mo_hist,
data.frame(