summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--R/preprocess.R3
1 files changed, 2 insertions, 1 deletions
diff --git a/R/preprocess.R b/R/preprocess.R
index 698e016..3edd3ba 100644
--- a/R/preprocess.R
+++ b/R/preprocess.R
@@ -189,10 +189,11 @@ dataSlice <- function(data,start=NULL,end=NULL,freq=NULL){
stop("Not an idframe data")
indexWindow <- function(y,start,end,freq){
- Y <- as.matrix(y); z <- as.vector(time(y))
+ Y <- matrix(y,ncol=ncol(y)); z <- as.vector(time(y))
Y <- window(Y,start=start,end=end,frequency=freq)
zw <- window(z,start=start,end=end,frequency=freq)
y <- ts(Y,start=zw[1],end=tail(zw,n=1),deltat=diff(zw)[1])
+ y
}
if(nOutputSeries(data)!=0)
outputData(data) <- indexWindow(outputData(data),start,end,freq)