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/mkin_wide_to_long.R | 1 + 1 file changed, 1 insertion(+) (limited to 'R/mkin_wide_to_long.R') diff --git a/R/mkin_wide_to_long.R b/R/mkin_wide_to_long.R index bef0e408..971f5273 100644 --- a/R/mkin_wide_to_long.R +++ b/R/mkin_wide_to_long.R @@ -21,6 +21,7 @@ if(getRversion() >= '2.15.1') utils::globalVariables(c("name", "time", "value")) #' @export mkin_wide_to_long <- function(wide_data, time = "t") { + wide_data <- as.data.frame(wide_data) colnames <- names(wide_data) if (!(time %in% colnames)) stop("The data in wide format have to contain a variable named ", time, ".") vars <- subset(colnames, colnames != time) -- cgit v1.2.1