count_neighbors: Count Neighbors within a Radius

View source: R/geom_pointdensity.R

count_neighborsR 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.


LKremer/ggpointdensity documentation built on June 10, 2025, 5:03 a.m.