diff options
author | Suraj Yerramilli | 2015-02-06 22:36:57 +0530 |
---|---|---|
committer | Suraj Yerramilli | 2015-02-06 22:36:57 +0530 |
commit | 42cd9b42fb05596cd1ed81935df79c885c7e02ad (patch) | |
tree | 34b398b038590be4f25b78a7b50727330c8dd8ba | |
parent | c6e753162add6d331c665b629c71594bfd448693 (diff) | |
download | SysID-R-code-42cd9b42fb05596cd1ed81935df79c885c7e02ad.tar.gz SysID-R-code-42cd9b42fb05596cd1ed81935df79c885c7e02ad.tar.bz2 SysID-R-code-42cd9b42fb05596cd1ed81935df79c885c7e02ad.zip |
corrected data splitting code
-rw-r--r-- | R/partition.R | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/R/partition.R b/R/partition.R index 0b88f6c..ab9dba6 100644 --- a/R/partition.R +++ b/R/partition.R @@ -20,9 +20,11 @@ dataSlice <- function(object,indices){ if(trim$type=="freq"){ trim$frequncies <- trim$frequencies[indices] } else { - trim$t.start <- trim$t.start + Ts*(indices[1]-1) - trim$t.end <- trim$t.start + Ts*(length(indices)-1) + trim$t.start <- trim$t.start + trim$Ts*(indices[1]-1) + trim$t.end <- trim$t.start + trim$Ts*(length(indices)-1) } + + return(trim) } #' Split data into training and validation sets @@ -47,5 +49,5 @@ dataPartition <- function(object,p=0.6){ train <- dataSlice(object,trainIndex) test <- dataSlice(object,testIndex) - return(estimation=train,validation=test) + return(list(estimation=train,validation=test)) }
\ No newline at end of file |