SeriesDetrend: Detrend time series.

View source: R/SeriesDetrend.R

SeriesDetrendR Documentation

Detrend time series.

Description

Processes the output of pretreatment_data() function to de-trend the time series.

Usage

SeriesDetrend(
  series = NULL,
  smoothing.yr = NULL,
  detr.type = "rob.loess",
  out.dir = NULL,
  plot_pdf = T
)

Arguments

series

Output of pretreatment_data().

smoothing.yr

Smoothing window width.

detr.type

Smoothing function used:

"rob.loess"

robust Loess

"rob.lowess"

robust Lowess with 4 iterations

"mov.mode"

moving median (aka. method #4 in Matlab CharAnalysis version)

out.dir

Folder to output the generated figures to. Defaults to NULL, and the figures are generated to default device instead.

plot_pdf

Logical. If TRUE, a *.pdf file will be written in the out.dir folder.

Value

A list similar to series with additional detrended data appended.

Examples

co <- tapas::co_char_data
co_i <- tapas::pretreatment_data(co)
co_i_detr <- tapas::SeriesDetrend(co_i, smoothing.yr = 1000)


wfinsinger/tapas documentation built on Aug. 22, 2024, 4:28 a.m.