Skip to content
Prev 28130 / 29559 Next

How to efficiently generate data of neighboring points

I tried looking at rtree package and even run the example at
https://github.com/hunzikp/rtree but it gives me the same error message
Error in UseMethod("withinDistance", rTree) :
   no applicable method for 'withinDistance' applied to an object of class
"c('list', 'RTree')"
That is strange given the page shows it was successful.

Regarding the library(spdep) and using dnearneigh(), I read through the
examples here https://r-spatial.github.io/spdep/reference/dnearneigh.html
but I seem to have a challenge as to how to get the output from wd1,wd2,
wd3, wd4  to my output object as in dataout.
For example when I call wd1, I get :
Neighbour list object:
Number of regions: 101
Number of nonzero links: 38
Percentage nonzero weights: 0.3725125
Average number of links: 0.3762376
67 regions with no links:


How do I get the original point IDs and their respective neighbors IDs?

Lom
On Tue, Jun 2, 2020 at 11:29 AM Roger Bivand <Roger.Bivand at nhh.no> wrote:

            

  
  

Thread (19 messages)