DeTrend: Linearly detrend a sample

View source: R/All.R

DeTrendR Documentation

Linearly detrend a sample

Description

Applies a linear detrend to a sample

Usage

DeTrend(x)

Arguments

x

a numeric vector

Details

Adjusts all the values in the sample, of size n, by the difference between the linearly modelled ith data point and the linearly modelled nth data point.

Value

A numeric vector which is a linearly detrended version of x.

Author(s)

Anthony Hammond

Examples

# Get an annual maximum (AM) sample that looks to have a significant trend
AM.21025 <- GetAM(21025)
# plot the resulting AM as a bar plot. Then detrend and compare with another plot
plot(AM.21025$Flow, type = "h", ylab = "Discharge (m3/s)")
AM.Detrend <- DeTrend(AM.21025$Flow)
plot(AM.Detrend, type = "h", ylab = "Discharge (m3/s)")

UKFE documentation built on Nov. 6, 2023, 1:07 a.m.

Related to DeTrend in UKFE...