Find peaks/troughs

TPIhelper(y)

Arguments

y

Numeric vector

Value

converted y with values 1 (trough); 2 (decrease); 3 (same); 5 (increase); 5 (peak)