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. Is there any fast and suitable way to do this?
Thank you all in advance