summaryrefslogtreecommitdiff
path: root/R
diff options
context:
space:
mode:
authorSuraj Yerramilli2015-08-20 17:32:07 +0530
committerSuraj Yerramilli2015-08-20 17:32:07 +0530
commit1dadd97b87e44b99cadc8eca7fb41a3da78218ff (patch)
treea8d75858b2161486c198da84bcf0237534033b19 /R
parent89d9f5b138c2424656e416da5b96e26852c31d9f (diff)
downloadSysID-R-code-1dadd97b87e44b99cadc8eca7fb41a3da78218ff.tar.gz
SysID-R-code-1dadd97b87e44b99cadc8eca7fb41a3da78218ff.tar.bz2
SysID-R-code-1dadd97b87e44b99cadc8eca7fb41a3da78218ff.zip
Simplified the detrend function
Diffstat (limited to 'R')
-rw-r--r--R/preprocess.R8
1 files changed, 4 insertions, 4 deletions
diff --git a/R/preprocess.R b/R/preprocess.R
index 8751645..bbe5f52 100644
--- a/R/preprocess.R
+++ b/R/preprocess.R
@@ -3,7 +3,7 @@
#' Removes the offsets or linear trends in each of the input and output matrices.
#'
#' @param data an object of class \code{idframe}
-#' @param type trend type - "constant" or "linear". (Default: \code{"linear"})
+#' @param type trend type - "constant" or "linear". (Default: \code{"constant"})
#'
#' @return
#' A list containing the following elements
@@ -18,15 +18,15 @@
#'
#' @examples
#' data(cstr)
-#' fit <- detrend(cstr) # remove linear trends
+#' fit <- detrend(cstr,type="linear") # remove linear trends
#' Zdetrend <- predict(fit) # get the detrended data
#'
-#' demean <- detrend(cstr,type="constant") # remove offsets
+#' demean <- detrend(cstr) # remove offsets
#' Zcent <- predict(demean) # get the centered data
#'
#' @seealso \code{\link{predict.detrend}}, \code{\link[stats]{lm}}
#' @export
-detrend <- function(data,type=c("constant","linear")[2]){
+detrend <- function(data,type=c("constant","linear")[1]){
if(!(type %in% c("constant","linear"))){
stop("Error: Invalid trend type")