summaryrefslogtreecommitdiff
path: root/man/detrend.Rd
blob: 2303b5b114610b0e764bb15db8cffdcca51497c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/preprocess.R
\name{detrend}
\alias{detrend}
\alias{trInfo}
\title{Remove offsets and linear trends}
\usage{
detrend(x, type = 0)
}
\arguments{
\item{x}{an object of class \code{idframe}}

\item{type}{argument indicating the type of trend to be removed (Default=\code{0})
\itemize{
  \item type=\code{0}: Subtracts mean value from each signal
  \item type=\code{1}: Subtracts a linear trend (least-squres fit)
  \item type=\code{trInfo} object: Subtracts a trend specified by the object
}}
}
\value{
A list containing two objects: the detrended data and the trend information
}
\description{
Removes offsets or trends from data
}
\details{
\code{R} by default doesn't allow return of multiple objects. The \code{\%=\%}
operator and \code{g} function in this package facillitate this behaviour. See 
the examples section for more information.
}
\examples{
data(cstr)
datatrain <- dataSlice(cstr,end=4500)
datatest <- dataSlice(cstr,4501)
g(Ztrain,tr) \%=\% detrend(datatrain) # Remove means
g(Ztest) \%=\% detrend(datatest,tr)

}
\seealso{
\code{\link[stats]{lm}}
}