summaryrefslogtreecommitdiff
path: root/R/kinresplot.R
diff options
context:
space:
mode:
Diffstat (limited to 'R/kinresplot.R')
-rw-r--r--R/kinresplot.R14
1 files changed, 14 insertions, 0 deletions
diff --git a/R/kinresplot.R b/R/kinresplot.R
new file mode 100644
index 0000000..be0a85d
--- /dev/null
+++ b/R/kinresplot.R
@@ -0,0 +1,14 @@
+kinresplot <- function(kinobject, kinmodel,
+ xlab = "Time [days]", ylab = "Residual [% of applied radioactivity]",
+ maxabs = "auto")
+{
+ m <- kinobject$fits[[kinmodel]]
+ t <- m$model$t
+ residuals <- residuals(m)
+ if (maxabs == "auto") maxabs = max(abs(residuals))
+ plot(t, residuals,
+ xlab = xlab,
+ ylab = ylab,
+ ylim = c( -1.2 * maxabs, 1.2 * maxabs))
+ title(paste("Residuals of", kinmodel, "fit"), font.main = 1)
+}

Contact - Imprint