hex_grid | R Documentation |
Overlays hexagonal grid cells of specified area onto equal area world map.
hex_grid(size)
size |
Integer specifying grid cell area (in square kilometers). |
World map projection is cylindrical equal area.
sf object containing:
geometry
grid cell geometry
hex
hex number ID. Each grid cell has a unique number
size
the area (in sqauare kilometers) of each grid cell
library(fungarium)
#import world shape file
shp <- rnaturalearth::ne_countries('large', returnclass = "sf")
#transform to cylindrical projection (equal area)
shp <- sf::st_transform(shp, crs = "+proj=cea +ellps=WGS84 +datum=WGS84")
#get grid
grid <- hex_grid(80000)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.