#--- Load raster and access files ---#
r <- system.file("extdata", "mraster.tif", package = "sgsR")
mr <- terra::rast(r)
#--- perform grid sampling ---#
sample_systematic(
raster = mr,
cellsize = 1000
)
sample_systematic(
raster = mr,
cellsize = 1000,
location = "corners",
plot = TRUE
)
sample_systematic(
raster = mr,
cellsize = 1000,
square = FALSE,
location = "random",
plot = TRUE
)
Run the code above in your browser using DataLab