Learn R Programming

speciesgeocodeR (version 1.0-4)

RichnessGrid: Species Richness and Abundance Grids from Point Records

Description

Create a species richness or abundance grid, from a spgeoOUT object or a data.frame with species names and occurrence coordinates.

Usage

RichnessGrid(x, limits = c(-180, 180, -90, 90), reso, type = c("spnum", "abu"))

Arguments

x
an object of the class data.frame or spgeoIN or spgeoOUT or character string. If x is a data.frame, it must consist of three columns, indicating species name, longitude and latitude. If x is a character string, it can be the name of a tab delimited text file, with three columns indicating species name, longitude and latitude or a vector of species names. In the latter case the GBIF database is search for geo-referenced occurrences.
limits
numerical. A vector of the form (xmin, xmax, ymin, ymax) givin the raster limits in decimal degrees.
reso
numeric. resolution of the grid in minutes.
type
character string indicating the type of data displayed: “spnum” = number of species per grid cell, “abu” = the number of occurrence points per grid cell.

Value

a raster object.

See Also

MapRichness, MapGrid, RangeRichness.

Examples

Run this code
# for x = data.frame
data(lemurs)
e <- c(-125, -105, 30, 50)
dat <- RichnessGrid(lemurs, e, reso = 60, type = "spnum")

# for x = character string
e <- c(-125, -105, 30, 50)

## Not run: 
# dat <- RichnessGrid("Indri indri", e, reso = 60, type = "spnum")
# ## End(Not run)

Run the code above in your browser using DataLab