From 45942cc099c258fa07f42691cf2e2ee163f3b6d6 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Mon, 6 Oct 2014 20:17:17 +0200 Subject: Avoid a warning produced by initial fits in gmkin --- NEWS.md | 3 ++- R/mkinfit.R | 16 +++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/NEWS.md b/NEWS.md index 0d690b37..19745300 100644 --- a/NEWS.md +++ b/NEWS.md @@ -16,13 +16,14 @@ - `plot.mkinfit()`: Avoid a warning message about only using the first component of ylim that occurred when ylim was specified explicitly - ## MINOR CHANGES - The formatting of differential equations in the summary was improved by wrapping overly long lines - The FOCUS_Z vignette was rebuilt with the above improvement and using a width of 70 to avoid output outside of the grey area +- `print.summary.mkinfit()`: Avoid a warning that occurred when gmkin showed summaries ofinitial fits without iterations + # CHANGES in mkin VERSION 0.9-32 ## NEW FEATURES diff --git a/R/mkinfit.R b/R/mkinfit.R index 0f488ec8..5c1de846 100644 --- a/R/mkinfit.R +++ b/R/mkinfit.R @@ -594,13 +594,15 @@ print.summary.mkinfit <- function(x, digits = max(3, getOption("digits") - 3), . cat("\nOptimised, transformed parameters:\n") print(signif(x$par, digits = digits)) - cat("\nParameter correlation:\n") - if (!is.null(x$cov.unscaled)){ - Corr <- cov2cor(x$cov.unscaled) - rownames(Corr) <- colnames(Corr) <- rownames(x$par) - print(Corr, digits = digits, ...) - } else { - cat("Could not estimate covariance matrix; singular system:\n") + if (x$niter != 0) { + cat("\nParameter correlation:\n") + if (!is.null(x$cov.unscaled)){ + Corr <- cov2cor(x$cov.unscaled) + rownames(Corr) <- colnames(Corr) <- rownames(x$par) + print(Corr, digits = digits, ...) + } else { + cat("Could not estimate covariance matrix; singular system:\n") + } } cat("\nResidual standard error:", -- cgit v1.2.1