Count the number of point-pairs in equally spaced distances bins. Code works in any dimension. If only one point set is provided, the distances of this point set with itself are used (counting each pairs only once, i.e. only ij, not ji).
paircount(x, y = NULL, dr, rmax, cpp = TRUE)
Returns a data frame of two column vectors:
mid-points of the distance bins.
number of pairs in the distance bin.
n-element vector or n-by-d matrix of d-dimensional positions of data points
optional m-element vector or m-by-d matrix of d-dimensional positions of a second point set
distance bin size
maximum distance to be considered
logical flag; if set to TRUE (default) a fast implementation in C++ is used, otherwise the counting is performed less efficiently in R.
Danail Obreschkow
landyszalay