aboutsummaryrefslogtreecommitdiff
path: root/R/mkin_wide_to_long.R
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2020-05-11 05:15:19 +0200
committerJohannes Ranke <jranke@uni-bremen.de>2020-05-11 05:18:32 +0200
commit234c9059a95e104917e488a6ddd2313234a96cdc (patch)
treef6e54098f79d94578434ef727b62f7cc5d5e79b7 /R/mkin_wide_to_long.R
parentd113cd79b178fdc91aecb894707ed356129dfb75 (diff)
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.
Diffstat (limited to 'R/mkin_wide_to_long.R')
-rw-r--r--R/mkin_wide_to_long.R1
1 files changed, 1 insertions, 0 deletions
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)

Contact - Imprint