detrend: Detrend a vector

Description Usage Arguments Details Value Author(s)

View source: R/ConvenienceFunctions.R

Description

Substract a linear trend from a vector

Usage

1
detrend(x, returntrend = FALSE)

Arguments

x

Vector or time series to be detrended

returntrend

When FALSE the detrended vector is returned, when TRUE a 2 element list is returned with both the trend and the detrended vector

Details

The linear trend is calculated as lm(x~1:length(x))

Value

The detrended vector. When returntrend = TRUE a 2 element list is returned with the trend and the detrended vector.

Author(s)

Tom Cox <tom.cox@uantwerp.be>


GPPFourier documentation built on Sept. 22, 2017, 5:06 p.m.