hexify

CRAN status CRAN downloads R-CMD-check Codecov test coverage License: MIT

Equal-area hexagonal grids for spatial analysis

Assign geographic points to hexagonal cells using the ISEA discrete global grid system. All cells have the same area regardless of latitude.

Installation

# install.packages("pak")
pak::pak("gcol33/hexify")

Quick Start

library(hexify)

# Your data
cities <- data.frame(
  name = c("Vienna", "Paris", "Madrid"),
  lon = c(16.37, 2.35, -3.70),
  lat = c(48.21, 48.86, 40.42)
)

# Create a grid and assign points
grid <- hex_grid(area_km2 = 10000)
result <- hexify(cities, lon = "lon", lat = "lat", grid = grid)

# Visualize
plot(result)

Key Features

Learn More

Support

“Software is like sex: it’s better when it’s free.” — Linus Torvalds

I’m a PhD student who builds R packages in my free time because I believe good tools should be free and open. I started these projects for my own work and figured others might find them useful too.

If this package saved you some time, buying me a coffee is a nice way to say thanks. It helps with my coffee addiction.

Buy Me A Coffee

License

MIT