Learn R Programming

RSEIS (version 2.1-6)

hilow: Find Maxima and Minima

Description

Search for Extrema along time series

Usage

hilow(y)

Arguments

y
time series

Value

  • LIST:
  • hiindexes to peaks
  • loindexes to valleys

See Also

peaks

Examples

Run this code
ex = seq(from=0, to=4*pi, length = 200)

y = sin(ex)
plot(ex, y, type='l')

peakval = hilow(y)

abline(v=ex[peakval$hi], col='green')
abline(v=ex[peakval$lo], col='red')

Run the code above in your browser using DataLab