From ba2141c7721bfdd6453fe5df653612c269828cc0 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Wed, 21 Oct 2015 15:33:23 +0200 Subject: Avoid an error printing old mkinfit summaries --- NEWS.md | 4 ++++ R/mkinfit.R | 15 ++++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/NEWS.md b/NEWS.md index e2b98d91..695a7603 100644 --- a/NEWS.md +++ b/NEWS.md @@ -12,6 +12,10 @@ - Use an index.r file to group help topics in static documentation +### Bug fixes + +- `print.summary.mkinfit()`: Avoid an error that occurred when printing summaries generated with mkin versions before 0.9-36 + ## mkin 0.9-40 (2015-07-21) ### Bug fixes diff --git a/R/mkinfit.R b/R/mkinfit.R index e2fd2951..4cc92f43 100644 --- a/R/mkinfit.R +++ b/R/mkinfit.R @@ -684,11 +684,16 @@ print.summary.mkinfit <- function(x, digits = max(3, getOption("digits") - 3), . cat("\nResidual standard error:", format(signif(x$sigma, digits)), "on", rdf, "degrees of freedom\n") - cat("\nBacktransformed parameters:\n", - " Confidence intervals for internally transformed parameters are asymmetric.\n", - " t-test (unrealistically) based on the assumption of normal distribution\n", - " for estimators of untransformed parameters.\n", sep = "") - print(signif(x$bpar[, c(1, 3, 4, 5, 6)], digits = digits)) + cat("\nBacktransformed parameters:\n") + cat(" Confidence intervals for internally transformed parameters are asymmetric.\n") + if ((x$version) < "0.9-36") { + cat(" To get the usual (questionable) t-test, upgrade mkin and repeat the fit.\n") + print(signif(x$bpar, digits = digits)) + } else { + cat(" t-test (unrealistically) based on the assumption of normal distribution\n") + cat(" for estimators of untransformed parameters.\n") + print(signif(x$bpar[, c(1, 3, 4, 5, 6)], digits = digits)) + } cat("\nChi2 error levels in percent:\n") x$errmin$err.min <- 100 * x$errmin$err.min -- cgit v1.2.1