Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

local.min.max

Local minimum and maximum


Description

Calculates the local minimums and maximums in a numeric vector, indicating inflection points in the distribution.

Usage

local.min.max(x, dev = mean, plot = TRUE, add.points = FALSE, ...)

Arguments

x

A numeric vector

dev

Deviation statistic (mean or median)

plot

plot the minimum and maximum values with the distribution (TRUE/FALSE)

add.points

Should all points of x be added to plot (TRUE/FALSE)

...

Arguments passed to plot

Value

A list object with:

  • minima - minimum local values of x

  • maxima - maximum local values of x

  • mindev - Absolute deviation of minimum from specified deviation statistic (dev argument)

  • maxdev - Absolute deviation of maximum from specified deviation statistic (dev argument)

Note

Useful function for identifying inflection or enveloping points in a distribution

Author(s)

Jeffrey S. Evans jeffrey_evans@tnc.org

Examples

x <- rnorm(100,mean=1500,sd=800) 
( lmm <- local.min.max(x, dev=mean, add.points=TRUE, 
                       main="Local Minima and Maxima") )

# return only local minimum values
   local.min.max(x)$minima

spatialEco

Spatial Analysis and Modelling Utilities

v1.3-6
GPL-3
Authors
Jeffrey S. Evans [aut, cre], Melanie A. Murphy [ctb], Karthik Ram [ctb]
Initial release
2021-03-24

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.