Skip to content
es50 maps and research work for GBIF.
R
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
R
data
plots
README.md

README.md

GBIF es50

Work on es50 maps for GBIF.

Scripts below for making simple hexagon es50 maps for any taxonKey using the api

installation


making an es50 map

library(roperators)
library(dplyr)
library(dggridR) # used to make hexagon grid
library(magrittr) # for %T>% pipe

taxonKey = "789"
spacing = 300 # space between hexagon grids in miles I think 
facet = "speciesKey" # which rank to use... # can also be genusKey

grid = dggridR::dgconstruct(spacing=spacing, metric=FALSE, resround='down') %>%
gbifrasters::getPolygonGrid(spacing,landOnly=FALSE) %>% # get from entire globe
gbifrasters::getData(taxonKey,facet=facet) %T>%  # get data from GBIF using facet api
saveRDS(file="C:/Users/ftw712/Desktop/grid.rda") # save data because it takes a while usually...

# grid = readRDS(file="C:/Users/ftw712/Desktop/gridTest.rda")

p = gbifrasters::plotPolyMap(grid,
variable="es50",
legend.position = c(.50,-0.06),
breaks=NULL,
labels=NULL,
polygon_text_size=3,
polygon_alpha = 1,
labelType="",
keywidth=0.01,
keyheight=0.3,
legend_text_size=15
)

p

Making es50 plot

getting data

You can’t perform that action at this time.