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
)

Arguments

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.

Value

A SpatialPolygonsDataFrame object, as used in the package 'sp'