This functions creates a blank raster based on the spatial extent of a Spatial object.

blank.raster(x, res)

Arguments

x

sp::Spatial object.

res

numeric vector specifying resolution of the output raster in the x and y dimensions. If vector is of length one, then the pixels are assumed to be square.

Examples

# make SpatialPolygons polys <- sim.pus(225L) # make RasterLayer from SpatialPolygons blank.raster(polys, 1)
#> class : RasterLayer #> dimensions : 15, 15, 225 (nrow, ncol, ncell) #> resolution : 1, 1 (x, y) #> extent : -7.5, 7.5, -7.5, 7.5 (xmin, xmax, ymin, ymax) #> crs : +proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0 #> source : memory #> names : layer #> values : 1, 1 (min, max) #>