Learn R Programming

changeRangeR (version 1.1.0)

mcp: Minimum Convex Hull Polygon

Description

Generates a minimum convex polygon (MCP; i.e., convex hull) that is delineated from occurrence locality coordinates. This function is a wrapper for `chull()` that makes a SpatialPolygons object.

Usage

mcp(xy, crs = NULL)

Value

a SpatialPolygons object of the minimum convex hull around occurrences.

Arguments

xy

Matrix or Data frame of occurrence coordinates

crs

Character of coordinate reference system for minimum convex hull

Examples

Run this code
# generate occurrences
ras1 <- raster::raster(nrows=108, ncols=108, xmn=-50, xmx=50)
raster::values(ras1)<- runif(n = (108*108))
occs <- dismo::randomPoints(ras1, 4)
# create mcp
mcp(occs)

Run the code above in your browser using DataLab