points_in_circle: Points in circle

Description Usage Arguments Value Author(s) Examples

View source: R/points_in_circle.R

Description

Find all observations in a data.frame within a circle of a certain radius.

Usage

1
2
3
4
5
6
7
8
points_in_circle(
  data,
  lon_center,
  lat_center,
  lon = lon,
  lat = lat,
  radius = 200
)

Arguments

data

data.frame with at least columns for longitude and latitude.

lon_center

numeric value referencing to the longitude of the center of the circle

lat_center

numeric value referencing to the latitude of the center of the circle

lon

column name in data with longitudes (lon is default).

lat

column name in data with latitudes (lat is default).

radius

radius (in meters) (defaults to 200m).

Value

data.frame. Column distance_m gives the distance to the center of the circle (in meters).

Author(s)

Martin Haringa

Examples

1
points_in_circle(Groningen, lon_center = 6.571561, lat_center = 53.21326, radius = 60)

spatialrisk documentation built on Nov. 10, 2021, 5:09 p.m.