powered by
Divides the region of interest in a grid of a specific cell size.
grid_from_region(region, cell_size, complete_cover = TRUE)
SpatialPolygonsDataFrame of the region of interest. Object must be unprojected, World Geodetic System (WGS84).
(numeric) resolution for grid (single number or vector of two numbers) in kilometers (km).
(logical) whether or not to include cells of grid partially overlapped with region. Default = TRUE.
Gridded SpatialPolygonsDataFrame for the region of interest. Each grid cell is related to a specific ID and longitude and latitude coordinates.
# NOT RUN { # Data data("mx", package = "biosurvey") # Create grid from polygon grid_reg <- grid_from_region(region = mx, cell_size = 100) sp::plot(grid_reg) grid_reg # }
Run the code above in your browser using DataLab