From fe16512e7f9e875340d498b01920e5967a2b7bd0 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Sat, 10 Sep 2016 03:13:33 +0200 Subject: Plot using R model if compiled model is not available --- R/plot.mkinfit.R | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'R/plot.mkinfit.R') 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 -- cgit v1.2.1