createPlotPoly: Create SpatialPolygon same size as a plot

View source: R/createPlotPoly.r

createPlotPolyR Documentation

Create SpatialPolygon same size as a plot

Description

This function creates a "rectangular" SpatialPolygon object with the same dimensions as a plot window. It is especially useful for cropping subsequent rasters or SpatialPolygon objects that would benefit from cropping. A plot must be made before calling this function.

Usage

createPlotPoly(x = NULL)

Arguments

Either

NULL or an object of class CRS, a coordinate reference string (proj4 string), or an object with a CRS. If any of these is provided, the SpatialPolygon object will have this CRS.

Value

SpatialPolygon

Examples

data(mad0)
plot(mad0)
poly <- createPlotPoly(mad0)
plot(poly, border='blue')
plot(mad0, add=TRUE)


adamlilith/enmSdm documentation built on Jan. 6, 2023, 11 a.m.