This function counts the number of neighboring points within a specified radius for each point in a given set of coordinates using a C implementation.
count_neighbors(x, y, r2, xy)A numeric vector where each element represents the count of neighboring points within the specified radius for each point.
A numeric vector of x-coordinates of the points.
A numeric vector of y-coordinates of the points.
A numeric value representing the squared radius within which to search for neighboring points.
A numeric value representing the aspect ratio (usually the ratio of the y-scale to the x-scale).