Learn R Programming

rangeMapper (version 0.2-0)

vertices-methods: Vertices of a SpatialPolygonsDataFrame

Description

Extract vertices from a SpatialPolygonsDataFrame and optionally applies an aggregating function to each Polygon.

Arguments

Value

References

Valcu, M., Dale, J. and Kempenaers, B. (2012) rangeMapper: A platform for the study of macroecology of life history traits. 21(9). (DOI: 10.1111/j.1466-8238.2011.00739.x)

See Also

coordinates.

Examples

Run this code
require(rangeMapper)
f = system.file(package = "rangeMapper", "extdata", "wrens", "vector")
camgul = selectShpFiles(f, ogr = TRUE, polygons.only = TRUE)[6, ] # path to Campylorhynchus_gularis breeding range
r = readOGR(camgul$dsn, camgul$layer)
mp = vertices(r, mean)
v = vertices(r)

plot(r)
points(mp, col = 2, pch = 3, cex = 2)
points(v, pch = 3, cex = .5)

Run the code above in your browser using DataLab