RangeRichness: Species Richness Raster from Range Polygons

View source: R/RangeRichness.R

RangeRichnessR Documentation

Species Richness Raster from Range Polygons

Description

Calculate species richness for the specified grid based on an list of range polygons, as derived from CalcRange.

Usage

RangeRichness(x, ras, reso = 1, buffer = 1, terrestrial = FALSE)

Arguments

x

a list of SpatialPolygons with species ranges.

ras

template raster to rasterize x. If missing, the raster is constructed using the data extent and reso.

reso

numeric. Resolution of the raster in decimal degree. Only if ras is missing.

buffer

numerical. The buffer around the polygon extent when plotting the map.

terrestrial

logical. If TRUE, oceans are omitted.

Value

a raster object with species number per gridcell.

Note

See https://github.com/azizka/speciesgeocodeR/wiki for more details and tutorials.

Examples

#simulate example occurrences
occ.exmpl<- data.frame(species = sample(letters, size = 250, replace = TRUE),
                       decimallongitude = runif(n = 250, min = 42, max = 51),
                       decimallatitude = runif(n = 250, min = -26, max = -11))

rang <- CalcRange(occ.exmpl, method = 'pseudospherical')
sprich <- RangeRichness(rang)
plot(sprich)

azizka/speciesgeocodeR documentation built on Sept. 5, 2023, 3:45 a.m.