thin_by_dist {tidysdm} | R Documentation |
Thin points dataset based on geographic distance
Description
This function thins a dataset so that only observations that have a distance from each other greater than "dist_min" are retained.
Usage
thin_by_dist(data, dist_min, coords = NULL)
Arguments
data |
An |
dist_min |
Minimum distance between points (in units appropriate for the projection, or meters for lonlat data). |
coords |
A vector of length two giving the names of the "x" and "y"
coordinates, as found in |
Details
Distances are measured in the appropriate units for the projection used. In case of raw latitude and longitude (e.g. as provided in a data.frame), the crs is set to WGS84, and units are set to meters.
This function is a modified version of the algorithm in spThin
, adapted
to work on sf
objects.
Value
An object of class sf::sf
or data.frame
, the same as "data".