aboutsummaryrefslogtreecommitdiff
path: root/R/mkinresplot.R
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2019-10-21 18:52:24 +0200
committerJohannes Ranke <jranke@uni-bremen.de>2019-10-21 18:54:37 +0200
commite09f726134ee273b6b191c1ec6465e6f701b082b (patch)
treeaabc6bec231fb9dd085deef57a030e41ec398bf4 /R/mkinresplot.R
parentbea054418c5310103252f5d243b2d18fcbf7b11f (diff)
Improve some plotting routines, more tests
Static documentation rebuilt by pkgdown
Diffstat (limited to 'R/mkinresplot.R')
-rw-r--r--R/mkinresplot.R18
1 files changed, 14 insertions, 4 deletions
diff --git a/R/mkinresplot.R b/R/mkinresplot.R
index 739a80e9..974d0549 100644
--- a/R/mkinresplot.R
+++ b/R/mkinresplot.R
@@ -1,4 +1,4 @@
-# Copyright (C) 2008-2014 Johannes Ranke
+# Copyright (C) 2008-2014,2019 Johannes Ranke
# Contact: jranke@uni-bremen.de
# This file is part of the R package mkin
@@ -21,7 +21,10 @@ mkinresplot <- function (object,
obs_vars = names(object$mkinmod$map),
xlim = c(0, 1.1 * max(object$data$time)),
xlab = "Time", ylab = "Residual",
- maxabs = "auto", legend= TRUE, lpos = "topright", ...)
+ maxabs = "auto", legend= TRUE, lpos = "topright",
+ col_obs = "auto", pch_obs = "auto",
+ frame = TRUE,
+ ...)
{
obs_vars_all <- as.character(unique(object$data$variable))
@@ -33,10 +36,17 @@ mkinresplot <- function (object,
if (maxabs == "auto") maxabs = max(abs(residuals), na.rm = TRUE)
- col_obs <- pch_obs <- 1:length(obs_vars)
+ # Set colors and symbols
+ if (col_obs[1] == "auto") {
+ col_obs <- 1:length(obs_vars)
+ }
+
+ if (pch_obs[1] == "auto") {
+ pch_obs <- 1:length(obs_vars)
+ }
names(col_obs) <- names(pch_obs) <- obs_vars
- plot(0, type = "n",
+ plot(0, type = "n", frame = frame,
xlab = xlab, ylab = ylab,
xlim = xlim,
ylim = c(-1.2 * maxabs, 1.2 * maxabs), ...)

Contact - Imprint