shipunov (version 1.5)

Peaks: Find local maxima

Description

Find local maxima

Usage

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

Arguments

series

Numerical vector

span

Window size

do.pad

Padding

Details

Finding peaks in a simple dataset.

Examples

Run this code
# NOT RUN {
## count peaks on joint histogram, this suggests number of clusters
histdata <- hist(apply(scale(iris[, -5]), 1, function(.x) sum(abs(.x))), breaks=10, plot=FALSE)
sum(Peaks(histdata$counts)) # 3 is the first value after 1 and does not change when 8 < breaks < 22
# }

Run the code above in your browser using DataCamp Workspace