bh_label_cycles: Label cycles & segments using robust_peaks

View source: R/old_code/bluehill_functions.2.R View source: R/bluehill_functions.R

bh_label_cyclesR Documentation

Label cycles & segments using robust_peaks

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 robust_peaks. As tests start at a trough and go to a peak, the testing direction is found by checking sign of the first peak/trough. Only works on "positive going" data, that is where the Load and Extension increase from start to peak. In other words, compressive studies must be inverted first.

Usage

bh_label_cycles(study, channel = "Extension", span = 5)

Arguments

study

a BlueHill study to mark with peaks and cycles.

channel

the data channel to search for peaks.

span

size of window to use when looking for peaks. Default is 5. 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.