count_neighbors {ggpointdensity} | R Documentation |
Count Neighbors within a Radius
Description
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.
Usage
count_neighbors(x, y, r2, xy)
Arguments
x |
A numeric vector of x-coordinates of the points. |
y |
A numeric vector of y-coordinates of the points. |
r2 |
A numeric value representing the squared radius within which to search for neighboring points. |
xy |
A numeric value representing the aspect ratio (usually the ratio of the y-scale to the x-scale). |
Value
A numeric vector where each element represents the count of neighboring points within the specified radius for each point.
[Package ggpointdensity version 0.2.0 Index]