find_local_optima returns the local optima of histograms
Source:R/find_local_optima.R
find_local_optima.Rd
find_local_optima returns the local optima of histograms
Arguments
- x
numeric vector representing the density of a histogram
- threshold
threshold for local optima, i.e. a point can only be considered a local optima if it differs from its neighbour optima by greater than the permitted threshold, default 0
- flat_endpoints
in regions of flat density, whether to return the endpoints or the midpoints
Examples
if (FALSE) {
x <- c(1,2,3,2,1,2,3,2,1)
find_local_optima(x)
}