From a4421eba19eae98a0bd00adb4e8c6d72cc49f9fb Mon Sep 17 00:00:00 2001 From: jranke Date: Thu, 20 May 2010 18:02:42 +0000 Subject: Various improvements, the most prominent being the addition of the test dataset from the original KinGUI Piacenza paper. git-svn-id: svn+ssh://svn.r-forge.r-project.org/svnroot/kinfit/pkg/mkin@10 edb9625f-4e0d-4859-8d74-9fd3b1da38cb --- R/mkin_wide_to_long.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (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 6db2f33..21ab77b 100644 --- a/R/mkin_wide_to_long.R +++ b/R/mkin_wide_to_long.R @@ -1,9 +1,9 @@ mkin_wide_to_long <- function(wide_data, time = "t") { 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) n <- length(colnames) - 1 - if (!(time %in% colnames)) stop("The data in wide format have to contain a variable named ", time, ".") long_data <- data.frame( name = rep(vars, each = length(wide_data[[time]])), time = rep(wide_data[[time]], n), -- cgit v1.2.1