Skip to contents

The function provides you with a random sample of x-y points where each point has a minimum distance from its neighbor. The output is an index-vector that can be used to subset/select the desired variables (e.g. x-location, y-location or other attributes) from the original data frame.

Usage

aa_sample_mindist(x, y, distance = 0, samples = 0)

Arguments

x

x

y

y

distance

Minimum distance in units of X-Y coordinates

samples

Number of samples

Details

Minimum distance sampling

The function first creates an index-vector for the input points, which is then shuffled randomly.Then a loop iterates through the random index-vector. In each iteration points are omitted from the vector that do not meet the minimum distance requirement.

Author

Dirk Pflugmacher