peaks: Find Peaks Within xy-Data

Description Usage Arguments Value See Also Examples

View source: R/peaks.R

Description

The function returns maxima (values which have only smaller neighbours) and minima (values which have only larger neighbours).

Usage

1
peaks(x, y=NULL, mode="maxmin")

Arguments

x, y

the coordinates of given points.

mode

specifies if both maxima and minima (mode="maxmin") or only maxima (mode="max") or minima (mode="min") are requested.

Value

A list with x and y coordinates of all peaks.

See Also

approx, upca

Examples

1
2
3
x <- sin(seq(0, 10, 0.1))
plot(x)
points(peaks(x), col="red", pch=15)

Example output

Loading required package: deSolve

simecol documentation built on Oct. 7, 2021, 9:20 a.m.