Map grid cell presence/absence
I am sequentially posting some self-contained functions for mapping biodiversity metrics in R.This function is currently contained within some of the endemism functions I have posted, but I have pulled it out so that it can be used in isolation:
map.pa.matrix.R [see full code at https://raw.githubusercontent.com/GregGuerin/biomap/master/map.pa.matrix.R]
Description --
Given georeferenced incidence data for species, generates a binary presence/absence matrix associated with grid cells of a raster.
Details --
This function generates a binary species presence/absence matrix associated with a raster layer based on georeferenced incidence data. This is a data processing step for mapping various biodiversity metrics onto raster layers. The outputs can be used as inputs into these functions, or if desired they can be used like site-based data (at the resolution of the raster) for various analysis such as ordination, or incidence/frequency data for particular species can be extracted.
Usage --
An example:
require(vegan)
data(mite)
data(mite.xy)
map.pa.matrix(mite, records="site", site.coords=mite.xy)
No comments:
Post a Comment