From 3a6b9f52c74d6ef88a8d32c50e42864b3f251719 Mon Sep 17 00:00:00 2001 From: jranke Date: Thu, 15 Mar 2012 15:54:14 +0000 Subject: Update kinfit and mkin to the latest version published on BerliOS. git-svn-id: svn+ssh://svn.r-forge.r-project.org/svnroot/kinfit/pkg/kinfit@17 edb9625f-4e0d-4859-8d74-9fd3b1da38cb --- R/kinresplot.R | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'R/kinresplot.R') diff --git a/R/kinresplot.R b/R/kinresplot.R index be0a85d..36eb55a 100644 --- a/R/kinresplot.R +++ b/R/kinresplot.R @@ -1,3 +1,23 @@ +# $Id: kinresplot.R 106 2011-05-12 10:55:37Z jranke $ + +# Copyright (C) 2008-2010 Johannes Ranke +# Contact: mkin-devel@lists.berlios.de + +# This file is part of the R package kinfit + +# kinfit is free software: you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. + +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +# details. + +# You should have received a copy of the GNU General Public License along with +# this program. If not, see + kinresplot <- function(kinobject, kinmodel, xlab = "Time [days]", ylab = "Residual [% of applied radioactivity]", maxabs = "auto") @@ -5,10 +25,11 @@ kinresplot <- function(kinobject, kinmodel, m <- kinobject$fits[[kinmodel]] t <- m$model$t residuals <- residuals(m) - if (maxabs == "auto") maxabs = max(abs(residuals)) + if (maxabs == "auto") maxabs = max(abs(residuals), na.rm = TRUE) plot(t, residuals, xlab = xlab, ylab = ylab, ylim = c( -1.2 * maxabs, 1.2 * maxabs)) + abline(h=0, lty=2) title(paste("Residuals of", kinmodel, "fit"), font.main = 1) } -- cgit v1.2.1