diff options
author | Suraj Yerramilli | 2015-04-01 22:55:30 +0530 |
---|---|---|
committer | Suraj Yerramilli | 2015-04-01 22:55:30 +0530 |
commit | f72d9a89d05f3f1c4cbeaa44b9e00d049fcd7c50 (patch) | |
tree | 4e3c9ec67b247ec25bcd650ecbb3ae18203d3e67 /R | |
parent | 43cdf2a49efab8a9f1ad1234a9a1d346e852d847 (diff) | |
download | SysID-R-code-f72d9a89d05f3f1c4cbeaa44b9e00d049fcd7c50.tar.gz SysID-R-code-f72d9a89d05f3f1c4cbeaa44b9e00d049fcd7c50.tar.bz2 SysID-R-code-f72d9a89d05f3f1c4cbeaa44b9e00d049fcd7c50.zip |
fixed errors in the data slice command
Diffstat (limited to 'R')
-rw-r--r-- | R/partition.R | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/R/partition.R b/R/partition.R index 7e1cc01..38e4c01 100644 --- a/R/partition.R +++ b/R/partition.R @@ -12,7 +12,7 @@ dataSlice <- function(data,start=NULL,end=NULL,freq=NULL){ nin <- dim(data$input)[2]; nout <- dim(data$output)[2] dataMatrix <- cbind(data$input,data$output) - if(type=="freq"){ + if(data$type=="freq"){ dataMatrix <- cbind(dataMatrix,data$frequencies) } else { timeSeq <- seq(from=data$t.start,to=data$t.end,by=data$Ts) @@ -22,8 +22,9 @@ dataSlice <- function(data,start=NULL,end=NULL,freq=NULL){ l <- as.list(dataMatrix) trimData <- as.data.frame(sapply(l,window,start=start,end=end,deltat=freq)) - trim <- idframe(output=trimData[,(nin+1):(nin+nout+1)],input=trimData[,1:nin], - type=data$type,Ts=data$tTs,tUnit=data$tUnit) + trim <- idframe(output=trimData[,(nin+1):(nin+nout),drop=F], + input=trimData[,1:nin,drop=F],type=data$type,Ts=data$Ts, + tUnit=data$tUnit) if(trim$type=="freq"){ trim$frequncies <- trimData[,ncol(trimData)] |