species_richness | R Documentation |
Species richness counts the number of potential species intersecting with a polygon grouped by the IUCN threat categorization. Note, that this indicator function requires the manual download of the respective raster files.
calc_species_richness(engine = "extract", stats = "mean")
engine |
The preferred processing functions from either one of "zonal", "extract" or "exactextract" as character. |
stats |
Function to be applied to compute statistics for polygons either one or multiple inputs as character. Supported statistics are: "mean", "median", "sd", "min", "max", "sum" "var". |
The specific meaning of the species richness indicator depends on the supplied raster file.
The required resources for this indicator are:
iucn
A function that returns an indicator tibble with IUCN layers with specified statistics as variable and respective species richness (count) as value.
## Not run:
library(sf)
library(mapme.biodiversity)
outdir <- file.path(tempdir(), "mapme-data")
dir.create(outdir, showWarnings = FALSE)
mapme_options(
outdir = outdir,
verbose = FALSE
)
iucn_dir <- system.file("res", "iucn", package = "mapme.biodiversity")
sr_rasters <- list.files(iucn_dir, pattern = "*_SR_*", full.names = TRUE)
aoi <- system.file("extdata", "sierra_de_neiba_478140_2.gpkg",
package = "mapme.biodiversity"
) %>%
read_sf() %>%
get_resources(get_iucn(sr_rasters)) %>%
calc_indicators(calc_species_richness(stats = "median")) %>%
portfolio_long()
aoi
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.