summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--R/partition.R8
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