plotExtent {enmSdmX} | R Documentation |
Create spatial polygon same size as a plot
Description
This function creates a "rectangular" SpatVector
object with the same dimensions as a plot window. It is especially useful for cropping subsequent rasters or vector objects to the plot window. A plot must be made before calling this function.
Usage
plotExtent(x = NULL)
Arguments
x |
Either |
Value
SpatVector
See Also
Examples
if (FALSE) {
library(sf)
data(mad0)
plot(st_geometry(mad0))
outline <- plotExtent(mad0)
plot(outline, col='cornflowerblue', lty='dotted')
plot(st_geometry(mad0), add=TRUE)
}
[Package enmSdmX version 1.1.6 Index]