Learn R Programming

hexify (version 0.3.8)

grid_rect: Generate a rectangular grid of hexagons

Description

Creates hexagon polygons covering a rectangular geographic region.

Usage

grid_rect(bbox, grid)

Value

sf object with hexagon polygons

Arguments

bbox

Bounding box as c(xmin, ymin, xmax, ymax), or an sf/sfc object

grid

A HexGridInfo object specifying the grid parameters

See Also

grid_global for global grids

Examples

Run this code
grid <- hex_grid(area_km2 = 5000)
europe <- grid_rect(c(-10, 35, 30, 60), grid)
plot(europe)

Run the code above in your browser using DataLab