knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(dplyr) library(sf)
occ <- occ_SAtlantic # occ_1M OR occ_SAtlantic
res_changes <- function(resolution = 2){ hex_res <- 1 # hex_res 0 is too big to work, all others work hex <- obisindicators::make_hex_res(resolution) # === Then assign cell numbers to the occurrence data: occ <- occ %>% mutate( cell = h3::geo_to_h3( data.frame(decimalLatitude, decimalLongitude), res = resolution)) idx <- calc_indicators(occ) grid <- hex %>% inner_join( idx, by = c("hexid" = "cell")) gmap_indicator(grid, "es", label = "ES(50)") }
Details of H3 resolution differences can be found in the h3geo docs. Resolutions range from 0 (largest) to 15 (smallest).
Generally, resolution 0 is too big to be useful... or even functional, sometimes.
res_changes(0)
res_changes(1)
At this resolution the S Atlantic is completely covered, meaning that every hex had enough data to compute the ES(50) diversity metric. We can see some basic expected patterns such as: * higher diversity near to the coast * higher diversity near the equator
res_changes(2)
A this resolution we see gaps throughout the central South Atlantic. These hexagons did not have enough occurrence records to calculate the diversity metric.
res_changes(3)
At this higher resolution, gaps dominate the map. Only places with relatively dense surveying efforts have enough data to calculate the diversity metric. Note how the relatively data-poor center has a relatively stark boundary spanning from the southern tip of Africa across. This boundary is visible in the diversity metric plots of lower resolution in the form of a high-low diversity boundary. The appearance of this abrupt high-low diversity boundary is likely an artifact of how data-poor the central South Atlantic is. The ES50 diversity metric will bias data-poor to more-diverse when there is extremely low amounts of data. It should be noted, however, that this bias is much less intense than the data-poor to less-diverse in other diversity metrics.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.