label_cycles: Label cycles & segments

View source: R/utility_functions.R

label_cyclesR Documentation

Label cycles & segments

Description

Given a data series, break into cycles (at each trough) break each cycle into load (trough -> peak) and unload (peak -> trough) segments, using turning points from peaksign. As tests start at a trough and go to a peak, the testing direction is found by checking sign of the first peak/trough.

Usage

label_cycles(series, span = 5)

Arguments

series

the list/vector of data to search for peaks.

span

size of window to use when looking for peaks. Defaults to 3. Larger spans are less sensitive to noise, but effectively smooth the series.

Value

a list of cycle numbers cycle = 1:n.cycles and segments seg = rep(c("load","unload")) both padded to the length of the original series


yadbor/bluer documentation built on Jan. 31, 2023, 7:44 p.m.