ropensci/rbison

Name: rbison

Owner: rOpenSci

Description: Wrapper to the USGS Bison API

Created: 2013-05-08 07:48:34.0

Updated: 2017-11-18 22:38:10.0

Pushed: 2018-01-05 19:47:55.0

Homepage:

Size: 6930

Language: R

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

rbison

Build Status Build status codecov.io rstudio mirror downloads cran version

Wrapper for the USGS Bison API.

Info

See https://bison.usgs.gov/#api for API docs for the BISON API.

Installation

From CRAN

all.packages("rbison")

Or the development version from Github

all.packages("devtools")
ools::install_github("ropensci/rbison")
ary('rbison')

Load package

ary("rbison")

Notice that the function bisonmap automagically selects the map extent to plot for you, being one of the contiguous lower 48 states, or the lower 48 plus AK and HI, or a global map. If some or all points outside the US, a global map is drawn, and throws a warning. . You may want to make sure the occurrence lat/long coordinates are correct.

get data
<- bison(species = "Phocoenoides dalli dalli", count = 10)
inspect summary
summary
 total specimen
     7        7
map occurrences
nmap(out)

plot of chunk unnamed-chunk-7

All points within the US (including AK and HI)
get data
<- bison(species = "Bison bison", count = 600)
inspect summary
summary
 total observation fossil specimen unknown centroid
  1217         252    162      796       7        1
map occurrences
nmap(out)

plot of chunk unnamed-chunk-10

All points within the contiguous 48 states
get data
<- bison(species = "Aquila chrysaetos", count = 600)
inspect summary
summary
 total observation fossil specimen unknown centroid
 84111       82185    102     1811      13        1
map occurrences
nmap(out)

plot of chunk unnamed-chunk-13

Map county or state level data
Counties - using last data call for Aquila
nmap(out, tomap = "county")

plot of chunk unnamed-chunk-14

States - using last data call for Aquila
nmap(out, tomap = "state")

plot of chunk unnamed-chunk-15

BISON SOLR interface
taxa

The taxa service searches for and gives back taxonomic names

n_tax(query = "*bear")
numFound
1] 12

names
     lc_vernacularName       vernacularName
   American black bear  American black bear
    Asiatic black bear   Asiatic black bear
     banded woollybear    banded woollybear
            black bear           black bear
      black-ended bear     black-ended bear
            brown bear           brown bear
          grizzly bear         grizzly bear
           Kodiak bear          Kodiak bear
  Louisiana black bear Louisiana black bear
0             Sun bear             Sun bear

highlight
ULL

facets
ULL

And you can search by scientific name

n_tax(query = "Helianthus*", method = "scientificName")
numFound
1] 215

names
                     scientificName
  Helianthus divaricatus latifolius
             Helianthus decapetalus
                Helianthus ambiguus
             Helianthus dowellianus
               Helianthus luxurians
               Helianthus anomalus 
            Helianthus longifolius 
               Helianthus arenicola
                Helianthus parishii
0             Helianthus floridanus

highlight
ULL

facets
ULL
occurrence search

The occurrence service searches by scientific names and gives back occurrence data similar to data given back by the bison() function

Searching for data and looking at output

n_solr(scientificName = "Ursus americanus", state_code = "New Mexico", rows = 50, fl = "eventDate,scientificName")
num_found
1] 4801

points
          eventDate   scientificName
  1995-05-28T00:00Z Ursus americanus
               <NA> Ursus americanus
  1973-09-19T00:00Z Ursus americanus
  1988-06-26T00:00Z Ursus americanus
  2012-09-24T00:00Z Ursus americanus
  2015-05-05T00:00Z Ursus americanus
  1996-05-28T00:00Z Ursus americanus
  2013-11-25T00:00Z Ursus americanus
               <NA> Ursus americanus
0              <NA> Ursus americanus
1              <NA> Ursus americanus
2              <NA> Ursus americanus
3              <NA> Ursus americanus
4 2009-06-07T00:00Z Ursus americanus
5 1958-09-11T00:00Z Ursus americanus
6 1951-10-14T00:00Z Ursus americanus
7              <NA> Ursus americanus
8              <NA> Ursus americanus
9              <NA> Ursus americanus
0              <NA> Ursus americanus
1              <NA> Ursus americanus
2              <NA> Ursus americanus
3              <NA> Ursus americanus
4              <NA> Ursus americanus
5              <NA> Ursus americanus
6 2012-10-27T00:00Z Ursus americanus
7 1955-08-27T00:00Z Ursus americanus
8 1950-09-04T00:00Z Ursus americanus
9 1954-12-28T00:00Z Ursus americanus
0 1955-08-27T00:00Z Ursus americanus
1 1954-10-13T00:00Z Ursus americanus
2 1953-10-22T00:00Z Ursus americanus
3 1957-01-14T00:00Z Ursus americanus
4 1953-10-15T00:00Z Ursus americanus
5 1954-11-12T00:00Z Ursus americanus
6 1955-03-01T00:00Z Ursus americanus
7 1956-05-24T00:00Z Ursus americanus
8 1958-06-06T00:00Z Ursus americanus
9 1958-08-27T00:00Z Ursus americanus
0 1967-06-13T00:00Z Ursus americanus
1              <NA> Ursus americanus
2 2012-05-30T16:38Z Ursus americanus
3              <NA> Ursus americanus
4 2012-08-30T00:00Z Ursus americanus
5 1995-11-25T00:00Z Ursus americanus
6              <NA> Ursus americanus
7              <NA> Ursus americanus
8              <NA> Ursus americanus
9 2015-06-04T00:00Z Ursus americanus
0 1931-10-21T00:00Z Ursus americanus

highlight
ULL

facets
facets$facet_queries
ULL

facets$facet_fields
ULL

facets$facet_dates
ULL

facets$facet_ranges
ULL


ttr(,"class")
1] "bison_solr"

Mapping the data

<- bison_solr(scientificName = "Ursus americanus", rows = 200)
nmap(out)

plot of chunk unnamed-chunk-19

Meta

This package is part of a richer suite called SPOCC Species Occurrence Data, along with several other packages, that provide access to occurrence records from multiple databases. We recommend using SPOCC as the primary R interface to rbison unless your needs are limited to this single source.

ropensci_footer


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.