View source: R/extract_metrics.R
extract_metrics | R Documentation |
Extract metric values to existing samples
extract_metrics(
mraster,
existing,
quiet = FALSE,
data.frame = FALSE,
filename = NULL,
overwrite = FALSE
)
mraster |
spatRaster. Metrics 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 metrics attributes.
If data.frame = TRUE
output will be written using write.table
Tristan R.H. Goodbody
Other extract functions:
extract_strata()
#--- Load mraster ---#
r <- system.file("extdata", "mraster.tif", package = "sgsR")
mr <- terra::rast(r)
#' #--- load existing samples ---#
e <- system.file("extdata", "existing.shp", package = "sgsR")
e <- sf::st_read(e)
extract_metrics(
mraster = mr,
existing = e
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.