From 234c9059a95e104917e488a6ddd2313234a96cdc Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Mon, 11 May 2020 05:15:19 +0200 Subject: Avoid merge() and data.frame() in cost function also for deSolve and eigenvalue based solutions. This noticeably increases performance for these methods, see test.log and benchmark vignette. --- R/add_err.R | 2 ++ 1 file changed, 2 insertions(+) (limited to 'R/add_err.R') diff --git a/R/add_err.R b/R/add_err.R index a523e9c2..9235223f 100644 --- a/R/add_err.R +++ b/R/add_err.R @@ -76,6 +76,8 @@ add_err <- function(prediction, sdfunc, secondary = c("M1", "M2"), { if (!is.na(seed)) set.seed(seed) + prediction <- as.data.frame(prediction) + # The output of mkinpredict is in wide format d_long = mkin_wide_to_long(prediction, time = "time") -- cgit v1.2.1