Learn R Programming

rangemap (version 0.1.18)

eoo: Extent of occurrence of a species based on convex hull polygons

Description

Extent of occurrence of a species based on convex hull polygons

Usage

eoo(occurrences, polygons)

Arguments

occurrences

a data.frame containing geographic coordinates of species occurrences, columns must be: Species, Longitude, and Latitude. Geographic coordinates must be in decimal degrees (WGS84).

polygons

SpatialPolygons object to clip convex hulls to these limits. Projection must be WGS84 (EPSG:4326).

Value

A list containing a SpatialPolygonsDataFrame of the extent of occurrence, and a vector with the areas in km2 of the spatial polygons resulted. Projection of resulting spatial object is Lambert Azimuthal Equal Area.

Details

Areas are calculated in square kilometers using the Lambert Azimuthal Equal Area projection, centered on the centroid of occurrence points given as inputs.

Examples

Run this code
# NOT RUN {
# occurrences
data("occ_f", package = "rangemap")
occ <- unique(occ_f)

# polygons
poly <- simple_wmap("simple", "Cuba")
LAEA <- LAEA_projection(occ[, 2:3])
poly_pr <- sp::spTransform(poly, LAEA)

# to fix topology problems
poly_pr <- rgeos::gBuffer(poly_pr, width = 0)

# EOO
eoo_pe <- eoo(occurrences = occ, polygons = poly_pr)
# }

Run the code above in your browser using DataLab