From bac02db46d5e332f3663f0b137c6bc4da7c73d8d Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Fri, 20 Feb 2015 10:23:03 +0100 Subject: Fix printing the summary if iterations are not available This was broken for using method.modFit = "SANN" --- .gitignore | 1 + NEWS.md | 1 + R/mkinfit.R | 5 ++++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 142e98f2..39eac04e 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ vignettes/*.toc vignettes/.build.timestamp vignettes/mkin.tex vignettes/FOCUS_Z.tex +mkin.Rcheck diff --git a/NEWS.md b/NEWS.md index fdd25051..929a8263 100644 --- a/NEWS.md +++ b/NEWS.md @@ -3,6 +3,7 @@ ## BUG FIXES - `mkinparplot()`: Avoid warnings that occurred when not all confidence intervals were available in the summary of the fit +- `print.summary.mkinfit()`: Fix printing the summary for the case that the number of iterations is not available # CHANGES in mkin VERSION 0.9-34 diff --git a/R/mkinfit.R b/R/mkinfit.R index 7a465c2b..08622f9c 100644 --- a/R/mkinfit.R +++ b/R/mkinfit.R @@ -388,6 +388,9 @@ mkinfit <- function(mkinmod, observed, } } + # Return number of iterations for SANN method + if (method.modFit == "SANN") fit$iter = maxit.modFit + # We need to return some more data for summary and plotting fit$solution_type <- solution_type fit$transform_rates <- transform_rates @@ -601,7 +604,7 @@ print.summary.mkinfit <- function(x, digits = max(3, getOption("digits") - 3), . cat("\nOptimised, transformed parameters:\n") print(signif(x$par, digits = digits)) - if (x$niter != 0) { + if (x$calls > 0) { cat("\nParameter correlation:\n") if (!is.null(x$cov.unscaled)){ Corr <- cov2cor(x$cov.unscaled) -- cgit v1.2.1