sp2raster: Convert a SpatialPolygonDataFrame to a raster. (Wrapper for...

View source: R/poly2spatialpoly.R

sp2rasterR Documentation

Convert a SpatialPolygonDataFrame to a raster. (Wrapper for raster::rasterize() with some reasonable defaults for the ereefs package)

Description

Convert a SpatialPolygonDataFrame to a raster. (Wrapper for raster::rasterize() with some reasonable defaults for the ereefs package)

Usage

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'


BarbaraRobson/ereefs documentation built on April 23, 2023, 5:47 a.m.