extract_strata {sgsR} | R Documentation |
Extract strata
Description
Extract stratum values to existing samples
Usage
extract_strata(
sraster,
existing,
quiet = FALSE,
data.frame = FALSE,
filename = NULL,
overwrite = FALSE
)
Arguments
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 |
Value
An sf or data.frame object of samples with strata attribute.
Note
If data.frame = TRUE
output will be written using write.table
Author(s)
Tristan R.H. Goodbody
See Also
Other extract functions:
extract_metrics()
Examples
#--- 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
)
[Package sgsR version 1.4.5 Index]