Calculate number of points within a certain radius for multi-type point patterns

by HAOYANG MI   Last Updated October 09, 2019 23:22 PM

I have two sets of points, A, and B, and they are defined in the same region.

For each point of A, I want to calculate how many points of type A and B are within the circle, respectively(radius = r)

I know the function 'nn2' from package ''RANN' can find the number pf nearest neighbors, however, it's only for one type of points. And another function 'marktable' from package 'spatstat' seems also do this job, but my datasets are too large so that it does not support. enter image description here Is there any fast and suitable way to do this?

Thank you all in advance

Related Questions

Updated May 27, 2015 03:09 AM

Updated June 08, 2016 08:09 AM

Updated September 26, 2018 18:22 PM

Updated August 15, 2016 08:09 AM