diff options
author | Johannes Ranke <jranke@uni-bremen.de> | 2016-09-10 03:13:33 +0200 |
---|---|---|
committer | Johannes Ranke <jranke@uni-bremen.de> | 2016-09-10 03:13:33 +0200 |
commit | fe16512e7f9e875340d498b01920e5967a2b7bd0 (patch) | |
tree | 3547afc4844006a3e29dd9801c1aee513ef69c67 | |
parent | e72f9a93d8ad6c5a9aa8fc5f015781a194e399b4 (diff) |
Plot using R model if compiled model is not available
-rw-r--r-- | DESCRIPTION | 4 | ||||
-rw-r--r-- | NEWS.md | 6 | ||||
-rw-r--r-- | R/plot.mkinfit.R | 11 |
3 files changed, 17 insertions, 4 deletions
diff --git a/DESCRIPTION b/DESCRIPTION index ef30256e..db72a3bd 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: mkin Type: Package Title: Kinetic Evaluation of Chemical Degradation Data -Version: 0.9.44 -Date: 2016-06-28 +Version: 0.9.44.9000 +Date: 2016-07-27 Authors@R: c(person("Johannes", "Ranke", role = c("aut", "cre", "cph"), email = "jranke@uni-bremen.de"), person("Katrin", "Lindenberger", role = "ctb"), @@ -1,5 +1,11 @@ # NEWS for package 'mkin' +## mkin 0.9.45 + +### Minor changes + +- `plot.mkinfit`: Plotting does not fail any more when the compiled model is not available, e.g. because it was removed from the temporary directory. In this case, the uncompiled model is now used for plotting + ## mkin 0.9.44 (2016-06-29) ### Bug fixes diff --git a/R/plot.mkinfit.R b/R/plot.mkinfit.R index 303effb5..00598737 100644 --- a/R/plot.mkinfit.R +++ b/R/plot.mkinfit.R @@ -53,8 +53,15 @@ plot.mkinfit <- function(x, fit = x, rownames(subset(fit$fixed, type == "deparm"))) odeparms <- parms.all[odenames] - out <- mkinpredict(fit$mkinmod, odeparms, odeini, outtimes, - solution_type = solution_type, atol = fit$atol, rtol = fit$rtol) + out <- try(mkinpredict(fit$mkinmod, odeparms, odeini, outtimes, + solution_type = solution_type, atol = fit$atol, rtol = fit$rtol), + silent = TRUE) + + if (inherits(out, "try-error")) { + out <- mkinpredict(fit$mkinmod, odeparms, odeini, outtimes, + solution_type = solution_type, atol = fit$atol, rtol = fit$rtol, + use_compiled = FALSE) + } names(col_obs) <- names(pch_obs) <- names(lty_obs) <- obs_vars |