Learn R Programming

RSEIS (version 4.2-4)

detrend: Remove trend from time series signal

Description

Remove trend from time series signal

Usage

detrend(x)

Value

vector with linear trend removed.

Arguments

x

vector

Author

Jonathan M. Lees<jonathan.lees@unc.edu>

Details

Removes the trend from a signal.

See Also

mean

Examples

Run this code

dt <- 0.001

 t <- seq(0, 6, by=0.001)


y <- 5*sin(2*pi*10*t)

plot(t,y, type='l')

y <- y  + 3 * t
plot(t,y, type='l')


dy <- detrend(y)

plot(t,dy, type='l')

Run the code above in your browser using DataLab