View source: R/local.min.max.R
local.min.max | R Documentation |
Calculates the local minimums and maximums in a numeric vector, indicating inflection points in the distribution.
local.min.max(x, dev = mean, plot = TRUE, add.points = FALSE, ...)
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 |
Useful function for identifying inflection or enveloping points in a distribution
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)
Jeffrey S. Evans jeffrey_evans@tnc.org
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.