Optimization of sampling site distribution in space based on environmental (or other) variables.
optim.spatial(layers, n, latlong = TRUE, clusterMap = TRUE)
A Raster* object (typically a multi-layer type: RasterStack or RasterBrick).
The number of intended sampling sites (clusters).
Boolean indicating whether latitude and longitude should be taken into account when clustering.
Boolean indicating whether to build a new raster with clusters.
Either a matrix of cells x clusters (also indicating distance to centroid, longitude and latitude of each cell) or a list with such matrix plus the clusterMap.
Optimizing the selection of sampling sites often requires maximizing the environmental diversity covered by them. One possible solution to this problem, here adopted, is performing a k-means clustering using environmental data and choosing the sites closest to the multidimensional environmental centroid of each cluster for sampling (Jimenez-Valverde & Lobo 2004)
Jimenez-Valverde, A., & Lobo, J. M. (2004) Un metodo sencillo para seleccionar puntos de muestreo con el objetivo de inventariar taxones hiperdiversos: el caso practico de las familias Araneidae y Thomisidae (Araneae) en la comunidad de Madrid, Espana. Ecologia, 18: 297-305.