detrend: Remove offsets and linear trends

Description Usage Arguments Details Value See Also Examples

Description

Removes offsets or trends from data

Usage

1
detrend(x, type = 0)

Arguments

x

an object of class idframe

type

argument indicating the type of trend to be removed (Default=0)

  • type=0: Subtracts mean value from each signal

  • type=1: Subtracts a linear trend (least-squres fit)

  • type=trInfo object: Subtracts a trend specified by the object

Details

R by default doesn't allow return of multiple objects. The %=% operator and g function in this package facillitate this behaviour. See the examples section for more information.

Value

A list containing two objects: the detrended data and the trend information

See Also

lm

Examples

1
2
3
4
5
data(cstr)
datatrain <- dataSlice(cstr,end=4500)
datatest <- dataSlice(cstr,4501)
g(Ztrain,tr) %=% detrend(datatrain) # Remove means
g(Ztest) %=% detrend(datatest,tr)

sysid documentation built on May 2, 2019, 4:18 a.m.