Learn R Programming

rangeBuilder (version 1.6)

getExtentOfList: Get extent of list of SpatialPolygons

Description

Returns the extent that encompasses all SpatialPolygons in a list

Usage

getExtentOfList(shapes)

Value

an object of class extent

Arguments

shapes

a list of SpatialPolygons

Author

Pascal Title

Examples

Run this code

data(crotalus)

# create some polygons, in this case convex hulls
sp <- split(crotalus, crotalus$genSp)
sp <- lapply(sp, function(x) x[,c('decimallongitude','decimallatitude')])
sp <- lapply(sp, function(x) x[chull(x),])
poly <- lapply(sp, function(x) 
	SpatialPolygons(list(Polygons(list(Polygon(x)), ID = 1))))

getExtentOfList(poly)

Run the code above in your browser using DataLab