View source: R/poly2spatialpoly.R
sp2raster | R Documentation |
Convert a SpatialPolygonDataFrame to a raster. (Wrapper for raster::rasterize() with some reasonable defaults for the ereefs package)
sp2raster(
sPdf,
xmn = 142.45,
ymn = -27.5,
resolution = 0.01,
xmx = NA,
ymx = NA,
r = NULL
)
sPdf |
SpatialPolygonDataFrame object, e.g. as output by poly2sp. |
xmn |
Minimum x value to use for the grid. Defaults to 142.45 |
ymn |
Minimum y value for the grid. Defaults to -27.5 |
resolution |
Grid resolution in degrees. Defaults to 0.01 |
xmax |
Maximum x value for the grid. Defaults to max value from the SpatialPolygonDataFrame bounding box. |
ymax |
Maximum y value for the grid. Defaults to max value from the SpatialPolygonDataFrame bounding box. |
A SpatialPolygonsDataFrame object, as used in the package 'sp'
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.