thinning_til_n {spatialRF} | R Documentation |
Applies thinning to pairs of coordinates until reaching a given n
Description
Resamples a set of points with x and y coordinates by increasing the distance step by step until a given sample size is obtained.
Usage
thinning_til_n(
xy,
n = 30,
distance.step = NULL
)
Arguments
xy |
A data frame with columns named "x" and "y" representing geographic coordinates. Default: |
n |
Integer, number of samples to obtain. Must be lower than |
distance.step |
Numeric, distance step used during the thinning iterations. If |
Value
A data frame with the same columns as xy with a row number close to n.
See Also
Examples
if(interactive()){
#loading example data
data(plant_richness_df)
#thinning to ~20 records
plant_richness.thin <- thinning_til_n(
x = plant_richness_df,
n = 20
)
plant_richness.thin
}
[Package spatialRF version 1.1.4 Index]