This commit is contained in:
dr. M.S. (Matthijs) Berends 2019-03-28 22:30:19 +01:00
parent 713290a9a6
commit 7dca9791a2
1 changed files with 16 additions and 13 deletions

View File

@ -37,16 +37,17 @@ set_mo_history <- function(x, mo, uncertainty_level, force = FALSE) {
if (NROW(mo_hist[base::which(mo_hist$x == x[i] & if (NROW(mo_hist[base::which(mo_hist$x == x[i] &
mo_hist$uncertainty_level >= uncertainty_level & mo_hist$uncertainty_level >= uncertainty_level &
mo_hist$package_v == utils::packageVersion("AMR")),]) == 0) { mo_hist$package_v == utils::packageVersion("AMR")),]) == 0) {
assign(x = "mo_history", tryCatch(
value = rbind(mo_hist, assign(x = "mo_history",
data.frame( value = rbind(mo_hist,
x = x[i], data.frame(
mo = mo[i], x = x[i],
uncertainty_level = uncertainty_level, mo = mo[i],
package_v = base::as.character(utils::packageVersion("AMR")), uncertainty_level = uncertainty_level,
stringsAsFactors = FALSE) package_v = base::as.character(utils::packageVersion("AMR")),
), stringsAsFactors = FALSE)),
envir = asNamespace("AMR")) envir = asNamespace("AMR")),
error = function(e) invisible())
} }
} }
} }
@ -113,9 +114,11 @@ clean_mo_history <- function(...) {
return(invisible()) return(invisible())
} }
} }
assign(x = "mo_history", tryCatch(
value = NULL, assign(x = "mo_history",
envir = asNamespace("AMR")) value = NULL,
envir = asNamespace("AMR")),
error = function(e) invisible())
cat(red("History removed.")) cat(red("History removed."))
} }
} }