This function extracts values from a raster mosaic based on the regions
defined in a shapefile using exactextractr::exact_extract()
.
mosaic_extract(mosaic, shapefile, fun = "median", ...)
A data frame containing the extracted values for each region defined in the shapefile.
A SpatRaster
object representing the raster mosaic from which
values will be extracted.
A shapefile, which can be a SpatVector
or an sf
object,
defining the regions of interest for extraction.
A character string specifying the summary function to be used for
extraction. Default is "median"
.
Additional arguments to be passed to exactextractr::exact_extract()
.