Learn R Programming

rgbif (version 0.4.0)

gist: Post a file as a Github gist

Description

You will be asked ot enter you Github credentials (username, password) during each session, but only once for each session. Alternatively, you could enter your credentials into your .Rprofile file with the entries

  1. options(github.username = "your_github_username")
  2. options(github.password = "your_github_password")

then gist will simply read those options.

gist was modified from code in the rCharts package by Ramnath Vaidyanathan

Usage

gist(gist, description = "", public = TRUE)

Arguments

gist
An object
description
brief description of gist (optional)
public
whether gist is public (default: TRUE)

Value

  • Posts your file as a gist on your account, and prints out the url for the gist itself in the console.

Examples

Run this code
library(plyr)
splist <- c('Accipiter erythronemius', 'Junco hyemalis', 'Aix sponsa')
keys <- sapply(splist, function(x) name_backbone(name=x, kingdom='plants')$speciesKey,
   USE.NAMES=FALSE)
out <- occ_search(keys, georeferenced=TRUE, limit=50, return="data")
dat <- ldply(out)
datgeojson <- stylegeojson(input=dat, var="name", color=c("#976AAE","#6B944D","#BD5945"),
   size=c("small","medium","large"))
write.csv(datgeojson, "~/my.csv")
togeojson(input="~/my.csv", method="web", outfilename="my")
gist("~/my.geojson", description = "Occurrences of three bird species mapped")

Run the code above in your browser using DataLab