Skip to content
Prev 24410 / 29559 Next

For each point, distance to nearest point in second dataset

Thanks Michael!

Super easy context: two SpatialPointsDataFrames ("voters",
"polling.places"). Each has coordinate columns "x" and "y".

Is it just:

library(nabor)
knn(voters, query = polling.places, k=1)

?
On Thu, May 19, 2016 at 2:59 PM Michael Sumner <mdsumner at gmail.com> wrote: