diff options
-rw-r--r-- | NAMESPACE | 1 | ||||
-rw-r--r-- | R/idframe.R | 4 | ||||
-rw-r--r-- | man/dataSlice.Rd | 4 | ||||
-rw-r--r-- | man/predict.detrend.Rd | 4 |
4 files changed, 7 insertions, 6 deletions
@@ -60,3 +60,4 @@ export(spa) export(step) export(tf) import(tframe) +importFrom(zoo,na.approx) diff --git a/R/idframe.R b/R/idframe.R index aed020d..265bca7 100644 --- a/R/idframe.R +++ b/R/idframe.R @@ -32,7 +32,7 @@ idframe <- function(output=NULL,input=NULL,Ts = 1,start=0,end=NULL, start <- end - Ts*(n-1) } - l3 <- lapply(l,ts,start=start,deltat=1/Ts) + l3 <- lapply(l,ts,start=start,deltat=Ts) # Object Constructor dat <- list(output=l3[[1]],input=l3[[1]],unit=unit) @@ -73,7 +73,7 @@ summary.idframe <- function(x){ out_sum <- summary(outputData(x)) in_sum <- summary(inputData(x)) - out <- list(out_sum=out_sum,in_sum=in_sum,Ts=deltat(x)), + out <- list(out_sum=out_sum,in_sum=in_sum,Ts=deltat(x), unit=x$unit,nsample = dim(outputData(x))[1]) class(out) <- "summary.idframe" diff --git a/man/dataSlice.Rd b/man/dataSlice.Rd index cd3af74..5ff6f00 100644 --- a/man/dataSlice.Rd +++ b/man/dataSlice.Rd @@ -9,9 +9,9 @@ dataSlice(data, start = NULL, end = NULL, freq = NULL) \arguments{ \item{data}{an object of class \code{idframe}} -\item{start}{the start time of the period of interest} +\item{start}{the start index} -\item{end}{the end time of the period of interes} +\item{end}{the end index} \item{freq}{fraction of the original frequency at which the series to be sampled.} diff --git a/man/predict.detrend.Rd b/man/predict.detrend.Rd index f5fbf40..87b751f 100644 --- a/man/predict.detrend.Rd +++ b/man/predict.detrend.Rd @@ -20,8 +20,8 @@ Returns detrended \code{idframe} object based on linear trend fit } \examples{ data(cstr) -train <- dataSlice(cstr,end=5000) # subset the first 5000 indices -test <- dataSlice(cstr,start=6001) # subset from index 6001 till the end +train <- dataSlice(cstr,end=5000) +test <- dataSlice(cstr,start=6001) fit <- detrend(train) Ztrain <- predict(fit) Ztest <- predict(fit,test) |