detrend: detrend

detrendR Documentation

detrend

Description

Simple removal of mean and trend from a time series.

Usage

detrend(.data, silent = TRUE)

Arguments

.data

A data.frame containing variable 'Time' as the first column and a second-column from which to remove the mean and trend.

silent

Prints mean and trend only if set FALSE. Default is TRUE.

Details

Input must be a data.frame where the first column is 'Time' and the second is the variable from which to remove the mean and trend. Removing the mean often provides less numerical inaccuracy, and removing a trend (for spectral analysis) avoids the effect of a ramp function on an fft-produced spectrum for which the time series is assumed repetitive. For this calculation, NA values are replaced by interpolation or, where that is not possible, by zeroes.

Value

A modified version of data[, 2] only, with mean and trend removed.

Author(s)

William Cooper

Examples

AT <- detrend (RAFdata[, c('Time', 'ATX')])

NCAR/Ranadu documentation built on Jan. 27, 2023, 1:09 a.m.