| shape2Grid | R Documentation | 
shapeToGrid creates a raster grid given a spatial polygon and a grid resolution.
shape2Grid(shpolygon, resolution, ones = TRUE)
| shpolygon | A SpatialPolygon, SpatialPolygonDataFrame representing the desired shape of the grid. | 
| resolution | Numeric. Spatial resoltion of the grid. | 
| ones | Logical. Fill with ones the values of the raster. If not the values will be written as cellID values. | 
Returns a raster object whith the shape of 'shpolygon' of a given resoltion.
## Not run: 
data("wrld_simpl", package = "maptools")
mx <- wrld_simpl[wrld_simpl$NAME=="Mexico",]
mx_grid <- bam::shape2Grid(mx,0.5)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.