spocc (version 0.2.4)

mapgist: 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

mapgist(data, description = "", file = "gistmap", dir = NULL,
  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)
file
File name (without file extension) for your geojson file. Default is 'gistmap'.
dir
Directory for storing file and reading it back in to create gist. If none is given, this function gets your working directory and uses that.
public
(logical) Whether gist is public (default: TRUE)
browse
If TRUE (default) the map opens in your default browser.
...
Further arguments passed on to spocc_stylegeojson

Details

See gist_auth for help on authentication

Examples

Run this code
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
mapgist(data=dat, color=c('#976AAE','#6B944D','#BD5945'))
mapgist(data=dat$gbif, color=c('#976AAE','#6B944D','#BD5945'))
mapgist(data=dat$ecoengine, color=c('#976AAE','#6B944D','#BD5945'))

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

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

Run the code above in your browser using DataLab