The function calculates a local maximum of the vector x surrounded by at least n.points lower numbers.
Usage
localmax(x, n.points=2)
Arguments
x
a vector of numbers.
n.points
a minimum number of lower values to determine the local maximum. Default is two points.
Value
The local maximum of the vector x is returned.
Details
The function calculates a local maximum of the vector x, i.e. the highest value of the vector x surrounded by at least n lower numbers. The concept of the local maximum applied to ERP analysis is taken from Luck (2005).
References
Luck, S., J. (2005). An Introduction to the Event-Related Potential Technique.
Cambridge, Mass.: The MIT Press.