aboutsummaryrefslogtreecommitdiff
path: root/R/mkinfit.R
diff options
context:
space:
mode:
Diffstat (limited to 'R/mkinfit.R')
-rw-r--r--R/mkinfit.R8
1 files changed, 2 insertions, 6 deletions
diff --git a/R/mkinfit.R b/R/mkinfit.R
index e1089673..f6691b1b 100644
--- a/R/mkinfit.R
+++ b/R/mkinfit.R
@@ -592,12 +592,8 @@ mkinfit <- function(mkinmod, observed,
method.ode = method.ode,
atol = atol, rtol = rtol, ...)
- out_long <- mkin_wide_to_long(out, time = "time")
-
- out_merged <- merge(observed[c("name", "time")], out_long)
- out_merged$name <- ordered(out_merged$name, levels = obs_vars)
- out_merged <- out_merged[order(out_merged$name, out_merged$time), ]
- observed$predicted <- out_merged$value
+ observed_index <- cbind(as.character(observed$time), as.character(observed$name))
+ observed$predicted <- out[observed_index]
}
# Define standard deviation for each observation

Contact - Imprint