View source: R/extract_strata.R
extract_strata | R Documentation |
Extract stratum values to existing samples
extract_strata(
sraster,
existing,
quiet = FALSE,
data.frame = FALSE,
filename = NULL,
overwrite = FALSE
)
sraster |
spatRaster. Stratification raster. |
existing |
sf 'POINT'. Existing plot network. |
quiet |
Logical. If |
data.frame |
Logical. Output as data.frame if |
filename |
Character. Path to write output samples. |
overwrite |
Logical. Choice to overwrite existing |
An sf or data.frame object of samples with strata attribute.
If data.frame = TRUE
output will be written using write.table
Tristan R.H. Goodbody
Other extract functions:
extract_metrics()
#--- Load sraster ---#
r <- system.file("extdata", "sraster.tif", package = "sgsR")
sr <- terra::rast(r)
#--- load existing samples ---#
e <- system.file("extdata", "existing.shp", package = "sgsR")
e <- sf::st_read(e)
extract_strata(
sraster = sr,
existing = e
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.