thin_by_dist | R Documentation |
This function thins a dataset so that only observations that have a distance from each other greater than "dist_min" are retained.
thin_by_dist(
data,
dist_min,
coords = NULL,
dist_method = c("great_circle", "euclidean")
)
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 |
dist_method |
method to compute distance, either "euclidean" or "great_circle". Defaults to "great_circle", which is more accurate but takes slightly longer. |
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.
An object of class sf::sf
or data.frame
, the same as "data".
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.