Skip to contents

Identifies local minima and maxima in a numeric vector using a sliding window of a given threshold. Used to detect changes in trend in smoothed hydrological data.

Usage

inflect(x, threshold = 1)

Arguments

x

Numeric vector (e.g., smoothed discharge time series).

threshold

Integer. Number of neighbors on each side to consider for identifying a local extremum.

Value

A list with two integer vectors: minima (indices of local minima) and maxima (indices of local maxima).