Skip to contents

This function takes a data frame of existing data, a data frame of desired sample sizes for each strata, the number of samples to take, and optionally a file name and overwrite parameter. It returns a sample of the existing data based on the desired sample sizes for each strata, and optionally writes the resulting samples to a file.

Usage

sample_existing_strat(
  existing,
  toSample,
  nSamp,
  filename = NULL,
  overwrite = FALSE
)

Arguments

existing

sf 'POINT'. Existing plot network.

toSample

A data frame specifying the desired sample sizes for each strata.

nSamp

Numeric. Number of desired samples. existing, include and force influence this value.

filename

Character. Path to write output samples.

overwrite

Logical. Choice to overwrite existing filename if it exists.

Value

An sf object that is a sub-sample of existing