
Find points within radius around one or more center coordinates
Source:R/deprecated-aliases.R, R/points_within_radius.R
points_within_radius.RdDeprecated.
`points_in_circle()` was renamed to [points_within_radius()].
This function selects rows from a data frame whose longitude/latitude coordinates fall within a given radius (in meters) from one or more specified center points. It also calculates the distance of each point to the center.
Usage
points_in_circle(
data,
lon_center,
lat_center,
lon = lon,
lat = lat,
radius = 200,
sort = TRUE
)
points_within_radius(
data,
lon_center,
lat_center,
lon = "lon",
lat = "lat",
radius = 200,
sort = TRUE
)Arguments
- data
A data frame containing at least longitude and latitude columns.
- lon_center
Numeric scalar or vector, longitude(s) of the circle center(s).
- lat_center
Numeric scalar or vector, latitude(s) of the circle center(s).
- lon
A string with the name of the longitude column in `data`.
- lat
A string with the name of the latitude column in `data`.
- radius
Numeric, circle radius in meters. Default is 200.
- sort
Logical, if `TRUE` results are sorted by distance within each center.