Helper for making maps of species occurrence data, including for:

This package has utilities for making maps with:

  • base R
  • ggplot2
  • ggplot2 with map layers - via ggmap pkg
  • Leaflet - via leaflet pkg
  • GitHub Gists - via gistr package

Installation

Install mapr

install.packages("mapr", dependencies = TRUE)

Or the development version from GitHub

devtools::install_github("ropensci/mapr")
library("mapr")
library("spocc")

Make maps

Leaflet

spp <- c('Danaus plexippus', 'Accipiter striatus', 'Pinus contorta')
dat <- occ(query = spp, from = 'gbif', has_coords = TRUE, limit = 50)
map_leaflet(dat)

leafletmap

Github gist

dat <- fixnames(dat)
map_gist(dat, color = c("#976AAE","#6B944D","#BD5945"))

gistmap

ggplot2 family maps

ggmaps

x <- occ(query = 'Lynx rufus californicus', from = 'gbif', limit = 100)
map_ggmap(x)

ggmaps

ggplot

map_ggplot(x, "usa")

ggplot2

Base R plots

map_plot(dat, size = 1, pch = 10)

basremap

via dismo

if that’s your jam, though you might find rgbif easier

library("dismo")
g <- gbif('Batrachoseps', 'luciae', geo = TRUE, end = 300)
map_leaflet(g, lon = "lon", lat = "lat", name = "scientificName")

dismomap

Meta

ropensci_footer