grid_from_region {biosurvey} R Documentation

## Creates grid for a given geographic region

### Description

Divides the region of interest in a grid of a specific cell size.

### Usage

grid_from_region(region, cell_size, complete_cover = TRUE)


### Arguments

 region SpatialPolygonsDataFrame of the region of interest. Object must be unprojected, World Geodetic System (WGS84). cell_size (numeric) resolution for grid (single number or vector of two numbers) in kilometers (km). complete_cover (logical) whether or not to include cells of grid partially overlapped with region. Default = TRUE.

### Value

Gridded SpatialPolygonsDataFrame for the region of interest. Each grid cell is related to a specific ID and longitude and latitude coordinates.

### Examples

# 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


[Package biosurvey version 0.1.1 Index]