summaryrefslogtreecommitdiff
path: root/R/kinresplot.R
diff options
context:
space:
mode:
authorjranke <jranke@edb9625f-4e0d-4859-8d74-9fd3b1da38cb>2012-03-15 15:54:14 +0000
committerjranke <jranke@edb9625f-4e0d-4859-8d74-9fd3b1da38cb>2012-03-15 15:54:14 +0000
commit3a6b9f52c74d6ef88a8d32c50e42864b3f251719 (patch)
treec80ebe6187fc88e77dd17da09135a168744ea23f /R/kinresplot.R
parentb9f180f177c2aca5d3a33e850b4fb0c51053bf2f (diff)
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
Diffstat (limited to 'R/kinresplot.R')
-rw-r--r--R/kinresplot.R23
1 files changed, 22 insertions, 1 deletions
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 <http://www.gnu.org/licenses/>
+
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)
}

Contact - Imprint