diff options
author | Johannes Ranke <jranke@uni-bremen.de> | 2015-10-16 16:31:29 +0200 |
---|---|---|
committer | Johannes Ranke <jranke@uni-bremen.de> | 2015-10-16 16:31:29 +0200 |
commit | 08cae49345c048fdbb69befc5a3b3f7966836223 (patch) | |
tree | e420c606903015f105d804af89b8165df5aad841 /R | |
parent | 4cc35d77e9ce6fb46f5ba37350a281bf0a82f286 (diff) |
Full compound names in models that are shown in the plot
Diffstat (limited to 'R')
-rw-r--r-- | R/mkinsub.R | 6 | ||||
-rw-r--r-- | R/plot.mkinfit.R | 8 |
2 files changed, 9 insertions, 5 deletions
diff --git a/R/mkinsub.R b/R/mkinsub.R index f92af54b..99c3ea20 100644 --- a/R/mkinsub.R +++ b/R/mkinsub.R @@ -1,4 +1,4 @@ -# Copyright (C) 2014 Johannes Ranke +# Copyright (C) 2014,2015 Johannes Ranke # Portions of this code are copyright (C) 2013 Eurofins Regulatory AG # Contact: jranke@uni-bremen.de @@ -16,8 +16,8 @@ # You should have received a copy of the GNU General Public License along with # this program. If not, see <http://www.gnu.org/licenses/> -mkinsub <- function(submodel, to = NULL, sink = TRUE) +mkinsub <- function(submodel, to = NULL, sink = TRUE, full_name = NA) { - return(list(type = submodel, to = to, sink = sink)) + return(list(type = submodel, to = to, sink = sink, full_name = full_name)) } # vim: set ts=2 sw=2 expandtab: diff --git a/R/plot.mkinfit.R b/R/plot.mkinfit.R index 31746fb8..f8ee600e 100644 --- a/R/plot.mkinfit.R +++ b/R/plot.mkinfit.R @@ -1,4 +1,4 @@ -# Copyright (C) 2010-2014 Johannes Ranke +# Copyright (C) 2010-2015 Johannes Ranke # Contact: jranke@uni-bremen.de # This file is part of the R package mkin @@ -76,7 +76,11 @@ plot.mkinfit <- function(x, fit = x, } matlines(out$time, out[obs_vars], col = col_obs[obs_vars], lty = lty_obs[obs_vars]) if (legend == TRUE) { - legend(lpos, inset= inset, legend = obs_vars, + legend_names = lapply(names(fit$mkinmod$spec), function(x) { + if (is.na(fit$mkinmod$spec[[x]]$full_name)) x + else fit$mkinmod$spec[[x]]$full_name + }) + legend(lpos, inset= inset, legend = legend_names, col = col_obs[obs_vars], pch = pch_obs[obs_vars], lty = lty_obs[obs_vars]) } # Show residuals if requested |