Learn R Programming

spoccutils (version 0.1.0)

map_gist: Make an interactive map to view in the browser as a Github gist

Description

Make an interactive map to view in the browser as a Github gist

Usage

map_gist(data, description = "", public = TRUE, browse = TRUE, ...)

Arguments

data
A data.frame, with any number of columns, but with at least the following: name (the taxonomic name), latitude (in dec. deg.), longitude (in dec. deg.)
description
Description for the Github gist, or leave to default (=no description)
public
(logical) Whether gist is public (default: TRUE)
browse
If TRUE (default) the map opens in your default browser.
...
Further arguments passed on to style_geojson

Details

See gist_auth for help on authentication

Examples

Run this code
library("spocc")
spp <- c('Danaus plexippus','Accipiter striatus','Pinus contorta')
dat <- occ(spp, from=c('gbif','ecoengine'), limit=30, gbifopts=list(hasCoordinate=TRUE))
dat <- fixnames(dat, "query")

# Define colors
map_gist(data=dat, color=c('#976AAE','#6B944D','#BD5945'))
map_gist(data=dat$gbif, color=c('#976AAE','#6B944D','#BD5945'))
map_gist(data=dat$ecoengine, color=c('#976AAE','#6B944D','#BD5945'))

# Define colors and marker size
map_gist(data=dat, color=c('#976AAE','#6B944D','#BD5945'), size=c('small','medium','large'))

# Define symbols
map_gist(data=dat, symbol=c('park','zoo','garden'))

Run the code above in your browser using DataLab