Skip to contents

This function samples a given set of existing data using balanced sampling techniques, which ensures that each stratum or subgroup of data is proportionally represented in the sample.

Usage

sample_existing_balanced(
  existing,
  nSamp,
  algorithm = "lpm2_kdtree",
  p = NULL,
  filename = NULL,
  overwrite = FALSE,
  ...
)

Arguments

existing

sf 'POINT'. Existing plot network.

nSamp

Numeric. Number of desired samples.

algorithm

Character. One of lpm2_kdtree, lcube, lcubestratified.

p

Numeric. Vector with length equal to the number of cells in mraster representing the inclusion probability for each candidate sample. Default = nSamp / N, where N is the number of cells.

filename

Character. Path to write stratified raster to disc.

overwrite

Logical. Specify whether filename should be overwritten on disc.

...

Additional arguments to pass to the selected sampling algorithm. This is leveraged when used by sample_existing() internally

Value

An sf object that is a sub-sample of existing