View source: R/RangeRichness.R
RangeRichness | R Documentation |
Calculate species richness for the specified grid based on an list of range polygons, as derived from CalcRange
.
RangeRichness(x, ras, reso = 1, buffer = 1, terrestrial = FALSE)
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 |
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. |
a raster
object with species number per gridcell.
See https://github.com/azizka/speciesgeocodeR/wiki for more details and tutorials.
#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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.