From af4a101d2cca91598ec5d1dc297c31a75517b139 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Fri, 17 Jan 2014 16:27:46 +0100 Subject: - Use mkinmod$spec instead of mkinmod$map wherever possible, in order to make it possible to to modify mkinmod$map when the mapping of internal to observed variables should be changed. Note that such modifications will confuse plot.mkinfit and summary.mkinfit. Setting the class attribute to modFit makes summary.modFit useable in such a case --- R/mkinfit.R | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'R') diff --git a/R/mkinfit.R b/R/mkinfit.R index 3e47479..fd53627 100644 --- a/R/mkinfit.R +++ b/R/mkinfit.R @@ -1,6 +1,6 @@ # $Id$ -# Copyright (C) 2010-2013 Johannes Ranke +# Copyright (C) 2010-2014 Johannes Ranke # Contact: jranke@uni-bremen.de # The summary function is an adapted and extended version of summary.modFit # from the FME package, v 1.1 by Soetart and Petzoldt, which was in turn @@ -42,7 +42,7 @@ mkinfit <- function(mkinmod, observed, mod_vars <- names(mkinmod$diffs) # Get the names of observed variables - obs_vars = names(mkinmod$map) + obs_vars = names(mkinmod$spec) # Subset observed data with names of observed data in the model observed <- subset(observed, name %in% obs_vars) @@ -110,12 +110,12 @@ mkinfit <- function(mkinmod, observed, # or a numeric ode solver from the deSolve package if (!solution_type %in% c("auto", "analytical", "eigen", "deSolve")) stop("solution_type must be auto, analytical, eigen or de Solve") - if (solution_type == "analytical" && length(mkinmod$map) > 1) + if (solution_type == "analytical" && length(mkinmod$spec) > 1) stop("Analytical solution not implemented for models with metabolites.") if (solution_type == "eigen" && !is.matrix(mkinmod$coefmat)) stop("Eigenvalue based solution not possible, coefficient matrix not present.") if (solution_type == "auto") { - if (length(mkinmod$map) == 1) { + if (length(mkinmod$spec) == 1) { solution_type = "analytical" } else { if (is.matrix(mkinmod$coefmat)) { -- cgit v1.2.1