1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-08 11:51:59 +02:00

(v0.7.1.9086) small fix

This commit is contained in:
2019-09-23 23:00:18 +02:00
parent ad5f211a8f
commit 38336d7408
10 changed files with 17 additions and 15 deletions

2
R/mo.R
View File

@ -241,7 +241,7 @@ as.mo <- function(x, Becker = FALSE, Lancefield = FALSE, allow_uncertain = TRUE,
pull(mo)
# save them to history
set_mo_history(x, y, 0, force = isTRUE(list(...)$force_mo_history))
set_mo_history(x, y, 0, force = isTRUE(list(...)$force_mo_history), disable = isTRUE(list(...)$disable_mo_history))
} else {
# will be checked for mo class in validation and uses exec_as.mo internally if necessary

View File

@ -60,8 +60,7 @@ 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() & warning_new_write == FALSE) {
message(blue(paste0("NOTE: results are saved to ", mo_history_file(), ".")))
if (is.null(mo_hist) & interactive()) {
warning_new_write <- TRUE
}
tryCatch(write.csv(rbind(mo_hist,
@ -73,10 +72,13 @@ set_mo_history <- function(x, mo, uncertainty_level, force = FALSE, disable = FA
stringsAsFactors = FALSE)),
row.names = FALSE,
file = mo_history_file()),
error = function(e) base::invisible())
error = function(e) { warning_new_write <- FALSE; base::invisible()})
}
}
}
if (warning_new_write == TRUE) {
message(blue(paste0("NOTE: results are saved to ", mo_history_file(), ".")))
}
return(base::invisible())
}