Visualize Species Occurrence Data

Utilities for visualizing species occurrence data. Includes functions to visualize occurrence data from 'spocc', 'rgbif', and other packages. Mapping options included for base R plots, 'ggplot2', 'ggmap', 'leaflet' and 'GitHub' 'gists'.


Build Status Build status codecov.io rstudio mirror downloads

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

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, cex = 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", "lat")

dismomap

Meta

  • Please report any issues or bugs.
  • License: MIT
  • Get citation information for mapr in R doing citation(package = 'mapr')
  • Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

ropensci_footer

News

mapr 0.3.4

MINOR IMPROVEMENTS

  • Now using markdown for docs (#27)
  • Replaced httr with crul as http client (#26)

Problem with ggmap

  • Note that there is a problem with map_ggmap due to a bug in ggmap. It is fixed in the ggmap dev version, so should be fixed in the CRAN version soon, hopefully.

mapr 0.3.0

NEW FEATURES

  • Now in all functions, when there's more than 1 taxon, we'll do a separate color for each taxon and draw a legend if applicable (#21) (#22)
  • Added support for adding convex hulls to some of the plot types (#23) thanks to @rossmounce for the feature request
  • map_leaflet() now adds metadata as a popup to each marker (#18) (#25)

mapr 0.2.0

NEW FEATURES

  • Released to CRAN.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("mapr")

0.4.0 by Scott Chamberlain, 3 months ago


https://github.com/ropensci/mapr


Report a bug at https://github.com/ropensci/mapr/issues


Browse source code at https://github.com/cran/mapr


Authors: Scott Chamberlain [aut, cre] (<https://orcid.org/0000-0003-1444-9135>)


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports ggplot2, leaflet, spocc, sp, rworldmap, RColorBrewer, jsonlite, gistr, data.table

Suggests testthat, ggmap, knitr, taxize, maptools


See at CRAN