Sample Existing Data Using Balanced Sampling
Source:R/sample_existing_balanced.R
sample_existing_balanced.Rd
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
, whereN
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