This function checks whether the existing sample data meets certain requirements for use in downstream analyses.
check_existing(existing, raster, nSamp, plot = FALSE, details = NULL)
If requirements are met, the function returns the prepared existing sample data. Otherwise, it raises a stop error with a relevant message.
sf 'POINT'. Existing plot network.
SpatRaster. Raster to guide the location of the samples. If type = "clhs"
this raster can also
be used to define the population distributions to be used for sampling.
Numeric. Number of desired samples.
Logical. If FALSE
(default) output is sf object of
systematic samples. If TRUE
returns a list of sf objects where tessellation
is the tessellation grid for sampling, and samples
are the systematic samples.