Learn R Programming

RSEIS (version 4.2-4)

peaks: Peaks

Description

Find peak amplitudes in a time series signal.

Usage

peaks(series, span = 3, do.pad = TRUE)

Value

vector of peak indexes

Arguments

series

signal

span

span for window

do.pad

padding

Author

Brian Ripley

Details

This function originated in a note from Brian Ripley.

Examples

Run this code

data(CE1)
plot(CE1$x, CE1$y, type='l')


pp <- seq(from=53, to=80, by=1)

plot(CE1$x[pp], CE1$y[pp], type='l')


aa <- peaks(CE1$y[pp], span=3)


abline(v=CE1$x[pp[aa]], col='red')



Run the code above in your browser using DataLab