Hi, you can add a new distance column and apply a filter to it.
I hope this help,
Gianandrea

coord <- 'your data frame'

library(geosphere)
dist <- vector()
for(i in 1:5){
  dist.tmp <- (distm(coord[1,],coord[i,],fun = distHaversine))
  dist <- c(dist,dist.tmp)
}
coord$dist <- dist
coord[coord$dist>100000,]





--
View this message in context: 
http://r.789695.n4.nabble.com/Select-all-districts-within-a-100-km-radius-of-a-district-tp4733799p4733801.html
Sent from the datatable-help mailing list archive at Nabble.com.
_______________________________________________
datatable-help mailing list
[email protected]
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help

Reply via email to