strat_quantiles {sgsR} | R Documentation |
Quantiles stratification
Description
Stratify metric raster using metric quantiles.
Usage
strat_quantiles(
mraster,
nStrata,
map = FALSE,
plot = FALSE,
details = FALSE,
filename = NULL,
overwrite = FALSE
)
Arguments
mraster |
spatRaster. ALS metrics raster. |
nStrata |
Numeric. A positive integer representing the number of desired classes
or a numeric vector of probabilities with values between |
map |
Logical. Map individual stratified layers to a combined stratification. Will output a multi-layer
|
plot |
Logical. Plots output strata raster and visualized strata with boundary dividers. |
details |
Logical. If |
filename |
Character. Path to write stratified raster to disc. |
overwrite |
Logical. Specify whether |
Value
Returns an output stratification spatRaster
or a list when details = TRUE
.
When a list is returned:
-
details
lookUp table for stratification(s). -
raster
is a stratifiedspatRaster
based on quantiles -
plot
is aggplot
histogram / scatter plot object (depends on whether metric2 was supplied). Histogram shows distribution and break points.
Author(s)
Tristan R.H. Goodbody
See Also
Other stratify functions:
strat_breaks()
,
strat_kmeans()
,
strat_map()
,
strat_poly()
Examples
#--- Load raster and existing plots---#
r <- system.file("extdata", "mraster.tif", package = "sgsR")
mr <- terra::rast(r)
strat_quantiles(
mraster = mr$zq90,
nStrata = 4
)
strat_quantiles(
mraster = mr[[1:2]],
nStrata = list(c(0.2, 0.4, 0.8), 3),
map = TRUE
)