Skip to contents

Perform the COunt of OBServations (coobs) algorithm using existing site data and raster metrics. This algorithm aids the user in determining where additional samples could be located by comparing existing samples to each pixel and associated covariates. The output coobs raster could be used to constrain clhs sampling to areas that are underreprented.

Usage

calculate_coobs(
  mraster,
  existing,
  cores = 1,
  threshold = 0.95,
  plot = FALSE,
  filename = NULL,
  overwrite = FALSE
)

Arguments

mraster

spatRaster. ALS metrics raster. Requires at least 2 layers to calculate covariance matrix.

existing

sf 'POINT'. Existing plot network.

cores

Numeric. Number of cores to use for parallel processing. default = 1.

threshold

Numeric. Proxy maximum pixel quantile to avoid outliers. default = 0.95.

plot

Logical. Plots output strata raster and visualized strata with boundary dividers.

filename

Character. Path to write stratified raster to disc.

overwrite

Logical. Specify whether filename should be overwritten on disc.

Value

Output raster with coobs and classified coobs layers.

Note

Special thanks to Dr. Brendan Malone for the original implementation of this algorithm.

References

Malone BP, Minasny B, Brungard C. 2019. Some methods to improve the utility of conditioned Latin hypercube sampling. PeerJ 7:e6451 DOI 10.7717/peerj.6451

Author

Tristan R.H. Goodbody

Examples

if (FALSE) {
#--- Load raster and existing plots---#
r <- system.file("extdata", "mraster.tif", package = "sgsR")
mr <- terra::rast(r)

e <- system.file("extdata", "existing.shp", package = "sgsR")
e <- sf::st_read(e)

calculate_coobs(
  mraster = mr,
  existing = e,
  cores = 4
)
}