aboutsummaryrefslogtreecommitdiff
path: root/R/mkin_wide_to_long.R
diff options
context:
space:
mode:
authorjranke <jranke@edb9625f-4e0d-4859-8d74-9fd3b1da38cb>2010-05-20 18:02:42 +0000
committerjranke <jranke@edb9625f-4e0d-4859-8d74-9fd3b1da38cb>2010-05-20 18:02:42 +0000
commita4421eba19eae98a0bd00adb4e8c6d72cc49f9fb (patch)
tree5692b056191b9197c900404410b17306da6526db /R/mkin_wide_to_long.R
parent16f5b1d3c0136413e92b2be0f20d365e92e9cd1c (diff)
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
Diffstat (limited to 'R/mkin_wide_to_long.R')
-rw-r--r--R/mkin_wide_to_long.R2
1 files changed, 1 insertions, 1 deletions
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),

Contact - Imprint