Skip to content
Prev 26687 / 29559 Next

How to find all first order neighbors of a collection of points

Roger anf Facu,

Thank you very much for the help. In terms of the data, I only provided the ID and Lat/Long pairs because they were the only covariates which were necessary. The data set we are using was purchased and contains voter registration information, voter history, and census tract information, after some geocoding took place. The locations are the residents houses, in this instance. 

I have rerun the knn with longlat = T, but I am still hung up on the idea of the first order neighbors. I have reread the vignette and section 5 discusses High-Order Neighbors, but there isn?t any mention of first or second order neighbors, as you mentioned above (?first order neighbors are not defined?). One of the pieces of literature I found said that polygons are problematic to work with, as are tesslations for precisely the reason you mentioned, non-planarity. For this reason, I am hung up on the idea of how to find all first order neighbors for a point, especially as the number of first order neighbors varies from point to point, and such knearneigh would not be appropriate here. 

If this is something that does not seem feasible, maybe another tactic is necessary.

Again, thank you all for the help.

Warmest
--
Benjamin Lieberman
Muhlenberg College 2019
Mobile: 301.299.8928