Find Peaks or Wells

ts_peaks(
  y,
  window = 3,
  includeWells = FALSE,
  minPeakDist = round(window/2),
  minPeakHeight = 0.2 * diff(range(y, na.rm = TRUE))
)

Arguments

y

A time series or numeric vector

window

Window in which to look for peaks or wells

includeWells

Find wells?

minPeakDist

Minimum distance between peaks or wells

minPeakHeight

Minimum height / depth for a peak / well

Value

Index with peak or well coordinates

Author

Fred Hasselman