trend: Trending and detrending data

View source: R/trend.R

trendR Documentation

Trending and detrending data

Description

Trend analysis and de-trending of data. The three methods trend.coef, trend.err and trend.pval are somewhat different to the other trend methods and designed for the use in apply operations, as reflected in the different sets of arguments. They are used in the other methods if the result argument is set to one of ["coef","err","pval"].

Usage

trend(x, result = "trend", model = "y ~ t", ...)

Arguments

x

The data object

result

"trend" returns the trend; "residual" returns the residual; "coef" returns the trend coefficient; "err" the error estimate; "pval" the p-value.

model

The trend model used by lm.

...

additional arguments

new

if TRUE plot in new window

Value

Similar type object as the input object

See Also

link{climatology}, link{anomaly}

Examples

data(ferder)
plot(annual(ferder,'max'), new=FALSE)
tr <- trend(annual(ferder,'max'))
lines(tr)
grid()
print(attr(tr,'coefficients'))
print(trend(ferder,results='pval'))


metno/esd documentation built on Sept. 9, 2024, 5:07 a.m.