<HTML><HEAD>
<META content="text/html; charset=utf-8" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.19222"></HEAD>
<BODY style="MARGIN: 4px 4px 1px; FONT: 10pt Tahoma">
<DIV>Try the function zerodist or remove.duplicates in sp, with zero set to 0.2</DIV>
<DIV> </DIV>
<DIV>Cheers, </DIV>
<DIV>Tim</DIV>
<DIV> </DIV>
<DIV><BR>>>>>>>>>>>></DIV>
<DIV>Date: Fri, 26 Apr 2013 15:10:57 +0100<BR>From: Ross Ahmed <rossahmed@googlemail.com><BR>To: <r-sig-geo@r-project.org><BR>Subject: [R-sig-Geo] remove points less than certain distance<BR>Message-ID: <CDA04981.4A46%rossahmed@gmail.com><BR>Content-Type: text/plain<BR><BR># I have a SpatialPointsDataFrame that contains points, some of which are<BR><=200m from each other, some of which points are >200m from each other.<BR>x <- c(-1.344, -1.345, -1.346, -1.346,-1.347, -1.328, -1.329, -1.33)<BR>y <- c(rep(54.76558, 3), 54.7610, 54.7611, rep(54.75167, 3))<BR>xy <- data.frame(x,y, values=rnorm(8))<BR>xy <- xy[sample(1:8, 8),]<BR>coordinates(xy) <- c("x", "y")<BR>proj4string(xy) <- CRS("+proj=longlat +ellps=WGS84 +datum=WGS84")<BR>plot(xy)<BR><BR># find which points are <= 200m<BR>spDists(xy) <= 0.2<BR><BR># of the points that are <=200m from each other, I need all but one of those<BR>points removed from xy. I should be left with 3 rows in xy. How do I do<BR>this?<BR><BR>Thanks<BR>Ross<BR><BR><BR></DIV></BODY></HTML>