This Quarto document and accompanying R script provide a reproducible workflow for visualizing species diversity using H3 hexagonal cells. It processes species occurrence data from a tab-delimited .txt file, calculates various diversity metrics, and generates a map in either an interactive HTML or a static PNG format.
-
Flexible Input: Reads species occurrence data from a specified .txt file (longitude, latitude and species should be present) as outputted by GBIF and OBIS
-
H3 Hexagon Integration: Utilizes the H3 geospatial indexing system to discretize the map into hexagons of a chosen resolution.
-
Multiple Diversity Metrics: Calculates and plots a range of diversity indices, including species richness, Shannon diversity, Simpson diversity, and Hill numbers.
-
Interactive HTML: Creates a dynamic, zoomable map using leaflet with OpenStreetMap base layer. Ideal for web-based sharing.
-
Static PNG: Generates a high-resolution image using ggplot2, suitable for publications or presentations.
Customizable Map Backgrounds: For PNG output, you can choose between an OpenStreetMap base layer or country borders.
More info: