[R-sig-Geo] Filtering a set of points by minimum distance between them

Roger Bivand Roger.Bivand at nhh.no
Thu Mar 3 10:12:04 CET 2011


On Thu, 3 Mar 2011, Arnald Marcer wrote:

> Hi,
>
> I have a set of coordinates in utm and need to get a subset of
> them in which any coordinate is at a minimum distance from
> any other one, that is to say, I need to filter them according
> to a minimum distance between them.
>
> Is there a function to do that or should I try to code it myself ?
> Is there also a way of introducing randomness in the sense that
> any run will give me a different set ?

The knearneigh() function in the spdep package calls functions in the RANN 
package to do this for planar coordinates - set the number of neighbours 
required to 1. You could look at the RANN package for non-deterministic 
solutions.

Roger

>
> Any help would be much appreciated
>
> Thanks
>
> Arnald Marcer
> CREAF (Centre for Ecological Research and Forestry Applications)
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no



More information about the R-sig-Geo mailing list