Resamples a set of points with x and y coordinates by increasing the distance step by step until a given sample size is obtained.

thinning_til_n(
xy,
n = 30,
distance.step = NULL
)

## Arguments

xy A data frame with columns named "x" and "y" representing geographic coordinates. Default: NULL Integer, number of samples to obtain. Must be lower than nrow(xy). Default: 30 Numeric, distance step used during the thinning iterations. If NULL, the one percent of the maximum distance among points in xy is used. Default: NULL

## Value

A data frame with the same columns as xy with a row number close to n.

thinning()

## Examples

if(interactive()){

}