View source: R/balance_around.R
keep_farthest | R Documentation |
This will take a set of existing points and new points and combine them to create a set consisting of the existing points and the farthest new points. The original intended use case was to take a collection of sampling locations from one or more sample designs (existing_points
) and use them as part of a new, spatially balanced sample design. The function takes a set of new, random, spatially balanced points (new_points
) and determines the distance between each of them and each of the existing points. It then sequentially eliminates the new point closest to any existing point until the combined number of existing points and remaining points is equal to target
.
keep_farthest( existing_points, new_points, target = NULL, projection = "+proj=longlat +datum=NAD83 +no_defs +ellps=GRS80 +towgs84=0,0,0", verbose = FALSE )
existing_points |
Point sf object. These are the points that will all be included in the output points and the points against which |
new_points |
Point sf object. These are the points that may be included in the output. The number that will be is equal to |
target |
Numeric value. The total number of points to include in the output. Defaults to |
projection |
Character string. The projection to force all spatial objects into. Defaults to NAD83, |
verbose |
Logical value. If |
A point sf object containing all the points from existing_points
and target - nrow(existing_points)
points from new_points
using the CRS specified in projection
. It will only have those variables that were in common between both existing_points
and new_points
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.