From 6168089ac43664c10ca2dc1281c8648fbf3b35a9 Mon Sep 17 00:00:00 2001 From: jranke Date: Sun, 14 Apr 2013 12:42:06 +0000 Subject: - Update the TODO list, setting some requirements for version 1.0 - Check that initial values specified using parms.ini are actually needed for the model, stop otherwise - List all formation fractions in the same place in the summary, also if they were fitted in the model - Include an FOMC model coupled to two metabolites in the unit tests - Some updates needed because of the above - Update of static documentation including the vignettes - Update of the mkin vignettes in the vignettes directory git-svn-id: svn+ssh://svn.r-forge.r-project.org/svnroot/kinfit/pkg/mkin@82 edb9625f-4e0d-4859-8d74-9fd3b1da38cb --- R/endpoints.R | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'R/endpoints.R') diff --git a/R/endpoints.R b/R/endpoints.R index 163dc8d4..c9a6a51f 100644 --- a/R/endpoints.R +++ b/R/endpoints.R @@ -11,6 +11,20 @@ endpoints <- function(fit, pseudoDT50 = FALSE) { ep$SFORB <- vector() for (obs_var in obs_vars) { type = names(fit$mkinmod$map[[obs_var]])[1] + + # Get formation fractions if directly fitted, and calculate remaining fraction to sink + f_names = grep(paste("f", obs_var, sep = "_"), names(parms.all), value=TRUE) + f_values = parms.all[f_names] + f_to_sink = 1 - sum(f_values) + names(f_to_sink) = ifelse(type == "SFORB", + paste(obs_var, "free", "sink", sep = "_"), + paste(obs_var, "sink", sep = "_")) + for (f_name in f_names) { + ep$ff[[sub("f_", "", sub("_to_", "_", f_name))]] = f_values[[f_name]] + } + ep$ff = append(ep$ff, f_to_sink) + + # Get the rest if (type == "SFO") { k_names = grep(paste("k", obs_var, sep="_"), names(parms.all), value=TRUE) k_tot = sum(parms.all[k_names]) -- cgit v1.2.1