summaryrefslogtreecommitdiff
path: root/R/detrend.R
diff options
context:
space:
mode:
authorunknown2015-04-02 15:44:50 +0530
committerunknown2015-04-02 15:44:50 +0530
commitb11662f4d96bc14843b8861fe80dc029a1804094 (patch)
treeb0eb01060082434b52b031a30428cd21c0a13fbb /R/detrend.R
parent45df9a7f22aebe42a628db9617f2f95de8f7d009 (diff)
downloadSysID-R-code-b11662f4d96bc14843b8861fe80dc029a1804094.tar.gz
SysID-R-code-b11662f4d96bc14843b8861fe80dc029a1804094.tar.bz2
SysID-R-code-b11662f4d96bc14843b8861fe80dc029a1804094.zip
corrected bugs
Diffstat (limited to 'R/detrend.R')
-rw-r--r--R/detrend.R4
1 files changed, 2 insertions, 2 deletions
diff --git a/R/detrend.R b/R/detrend.R
index 0fc6fd8..49122c2 100644
--- a/R/detrend.R
+++ b/R/detrend.R
@@ -40,14 +40,14 @@ detrend <- function(data,type=c("constant","linear")[2]){
data_detrend <- data
out <- data$output;output_trend <- list()
for(i in 1:ncol(out)){
- output_trend[[i]] <- lm(formula,X=out[,i])
+ output_trend[[i]] <- lm(formula,data=data.frame(X=out[,i]))
out[,i] <- fitted(output_trend[[i]])
}
input <- data$input;input_trend <- list()
for(i in 1:ncol(input)){
- input_trend[[i]] <- lm(formula,X=input[,i])
+ input_trend[[i]] <- lm(formula,data=data.frame(X=input[,i]))
input[,i] <- fitted(input_trend[[i]])
}