r <- system.file("extdata", "mraster.tif", package = "sgsR")
mr <- terra::rast(r)
#--- generate an existing sample adn extract metrics ---#
e <- sample_systematic(raster = mr, cellsize = 200)
e <- extract_metrics(existing = e, mraster = mr)
#--- perform clhs (default) sub-sampling ---#
sample_existing(
existing = e,
nSamp = 50
)
#--- perform balanced sub-sampling ---#
sample_existing(
existing = e,
nSamp = 50,
type = "balanced"
)
#--- perform simple random sub-sampling ---#
sample_existing(
existing = e,
nSamp = 50,
type = "srs"
)
Run the code above in your browser using DataLab