Re: [R] Finding local maxima (height) in a matrix data (6 spatial coordinates)?

From: Ben Bolker <>
Date: Thu, 21 Feb 2008 13:59:57 +0000 (UTC)

Josep Maria Campanera Alsina <campanera <at>> writes:

> Dear all,
> I wonder which R algorithm could perform a search of local maxima in
> an spatial grid, in other words, having the coordinates of a map
> (x,y,z... up to 6 coordinates) and then the altitude/height at each
> point (h) (in total 7 numerical variables) I would like to localise
> the peaks (local maxima) of that topological surface. Which R
> algorithm can perform this?

  optim finds local minima.
  The quick and dirty way to do this would be to start optim at many randomly chosen starting points within your space, and keep a list of the optima you found.
  Try googling "tabu search continuous" if you're interesting in some fancier approaches (don't think any of these are implemented in R, though).

  good luck
    Ben Bolker mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Thu 21 Feb 2008 - 14:07:25 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 21 Feb 2008 - 14:30:16 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive