### --- generate example stratification ---###
#--- load ALS metrics from sgsR internal data ---#
r <- system.file("extdata", "mraster.tif", package = "sgsR")
#--- read ALS metrics using the terra package ---#
mraster <- terra::rast(r)
#--- perform stratification ---#
sraster <- strat_kmeans(
mraster = mraster$zq90,
nStrata = 6
)
### --- create existing sample network ---###
#--- simple random sampling ---#
existing <- sample_srs(
raster = mraster$zq90,
nSamp = 100
)
#--- calculate representation ---#
calculate_representation(
sraster = sraster,
existing = existing
)
Run the code above in your browser using DataLab