Interface to the 'USGS' 'BISON' 'API'

Interface to the 'USGS' 'BISON' (< https://bison.usgs.gov/>) 'API', a 'database' for species occurrence data. Data comes from species in the United States from participating data providers. You can get data via 'taxonomic' and location based queries. A simple function is provided to help visualize data.


Wrapper for the USGS Bison API.

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

From CRAN

install.packages("rbison")

Or the development version from Github

install.packages("devtools")
devtools::install_github("ropensci/rbison")
library('rbison')

Load package

library("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.

out <- bison(species = "Phocoenoides dalli dalli", count = 10)
out$summary
#>   total specimen
#> 1     7        7
bisonmap(out)

out <- bison(species = "Bison bison", count = 600)
out$summary
#>   total observation fossil specimen unknown centroid
#> 1  1217         252    162      796       7        1
bisonmap(out)

out <- bison(species = "Aquila chrysaetos", count = 600)
out$summary
#>   total observation fossil specimen literature unknown centroid
#> 1 91482       80582    118      785        556    9441        1
bisonmap(out)

bisonmap(out, tomap = "county")

bisonmap(out, tomap = "state")

The taxa service searches for and gives back taxonomic names

bison_tax(query = "*bear")
#> $numFound
#> [1] 12
#> 
#> $names
#>       lc_vernacularName       vernacularName
#> 1   American black bear  American black bear
#> 2    Asiatic black bear   Asiatic black bear
#> 3     banded woollybear    banded woollybear
#> 4            black bear           black bear
#> 5      black-ended bear     black-ended bear
#> 6            brown bear           brown bear
#> 7          grizzly bear         grizzly bear
#> 8           Kodiak bear          Kodiak bear
#> 9  Louisiana black bear Louisiana black bear
#> 10             Sun bear             Sun bear
#> 
#> $highlight
#> NULL
#> 
#> $facets
#> NULL

And you can search by scientific name

bison_tax(query = "Helianthus*", method = "scientificName")
#> $numFound
#> [1] 215
#> 
#> $names
#>                       scientificName
#> 1  Helianthus divaricatus latifolius
#> 2             Helianthus decapetalus
#> 3                Helianthus ambiguus
#> 4             Helianthus dowellianus
#> 5               Helianthus luxurians
#> 6               Helianthus anomalus 
#> 7            Helianthus longifolius 
#> 8               Helianthus arenicola
#> 9                Helianthus parishii
#> 10             Helianthus floridanus
#> 
#> $highlight
#> NULL
#> 
#> $facets
#> NULL

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

bison_solr(scientificName = "Ursus americanus", state_code = "New Mexico", rows = 50, fl = "eventDate,scientificName")
#> $num_found
#> [1] 4801
#> 
#> $points
#>            eventDate   scientificName
#> 1  1995-05-28T00:00Z Ursus americanus
#> 2               <NA> Ursus americanus
#> 3  1973-09-19T00:00Z Ursus americanus
#> 4  1988-06-26T00:00Z Ursus americanus
#> 5  2012-09-24T00:00Z Ursus americanus
#> 6  2015-05-05T00:00Z Ursus americanus
#> 7  1996-05-28T00:00Z Ursus americanus
#> 8  2013-11-25T00:00Z Ursus americanus
#> 9               <NA> Ursus americanus
#> 10              <NA> Ursus americanus
#> 11              <NA> Ursus americanus
#> 12              <NA> Ursus americanus
#> 13              <NA> Ursus americanus
#> 14 2009-06-07T00:00Z Ursus americanus
#> 15 1958-09-11T00:00Z Ursus americanus
#> 16 1951-10-14T00:00Z Ursus americanus
#> 17              <NA> Ursus americanus
#> 18              <NA> Ursus americanus
#> 19              <NA> Ursus americanus
#> 20              <NA> Ursus americanus
#> 21              <NA> Ursus americanus
#> 22              <NA> Ursus americanus
#> 23              <NA> Ursus americanus
#> 24              <NA> Ursus americanus
#> 25              <NA> Ursus americanus
#> 26 2012-10-27T00:00Z Ursus americanus
#> 27 1955-08-27T00:00Z Ursus americanus
#> 28 1950-09-04T00:00Z Ursus americanus
#> 29 1954-12-28T00:00Z Ursus americanus
#> 30 1955-08-27T00:00Z Ursus americanus
#> 31 1954-10-13T00:00Z Ursus americanus
#> 32 1953-10-22T00:00Z Ursus americanus
#> 33 1957-01-14T00:00Z Ursus americanus
#> 34 1953-10-15T00:00Z Ursus americanus
#> 35 1954-11-12T00:00Z Ursus americanus
#> 36 1955-03-01T00:00Z Ursus americanus
#> 37 1956-05-24T00:00Z Ursus americanus
#> 38 1958-06-06T00:00Z Ursus americanus
#> 39 1958-08-27T00:00Z Ursus americanus
#> 40 1967-06-13T00:00Z Ursus americanus
#> 41              <NA> Ursus americanus
#> 42 2012-05-30T16:38Z Ursus americanus
#> 43              <NA> Ursus americanus
#> 44 2012-08-30T00:00Z Ursus americanus
#> 45 1995-11-25T00:00Z Ursus americanus
#> 46              <NA> Ursus americanus
#> 47              <NA> Ursus americanus
#> 48              <NA> Ursus americanus
#> 49 2015-06-04T00:00Z Ursus americanus
#> 50 1931-10-21T00:00Z Ursus americanus
#> 
#> $highlight
#> NULL
#> 
#> $facets
#> $facets$facet_queries
#> NULL
#> 
#> $facets$facet_fields
#> NULL
#> 
#> $facets$facet_dates
#> NULL
#> 
#> $facets$facet_ranges
#> NULL
#> 
#> 
#> attr(,"class")
#> [1] "bison_solr"

Mapping the data

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

  • Please report any issues or bugs.
  • License: MIT
  • Get citation information for rbison in R doing citation(package = 'rbison')
  • 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.

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.

News

rbison 0.5.0

  • Replace dplyr::rbind_all() with dplyr::bind_rows() (#39)
  • Base URLs changd for the BISON API (#34) (#43)
  • Fixed a URL in the docs (#44) thanks @esellers-usgs
  • Fixes for a new ggplot2 version in mapping function rbison::bisonmap() (#38)

rbison 0.4.8

  • Now explicitly importing all non-base R package functions that ship with R, in this case from stats and methods packages (#36)
  • .Rbuildignore the vignettes/figure directory (#37)
  • Using @importFrom across all package imports.
  • The query parameter in bison_tax() is now required.
  • Startup message is gone.
  • Changed to new base URLs for BISON APIs.

rbison 0.4.5

  • Fixes for \donttest.
  • Removed dependency on assertthat.
  • Sentence Case the Title in the DESCRIPTION file!!!!!!
  • Fixed a test for the bisonmap() function.

rbison 0.4.3

  • New function bison_stats() to query the statistics about BISON downloads.
  • New function citation_datause() to get information on data use rules, and citation for using BISON data.
  • New vignette other_functions that goes over the other functions in rbison. The main vignette covers bison() only.
  • Changed output of all data to have stringsAsFactors=FALSE.
  • Changed all callopts parameters to ..., so you can pass in named options to httr::GET calls instead of through callopts, except in functions that interact with a SOLR engine, in which case ... is reserved for passing on additional SOLR parameters, and then callopts is still used.
  • No longer importing data.table, importing dplyr now, and assertthat
  • Changed to MIT license.
  • Changed to jsonlite from rjson for JSON parsing.
  • bison() loses parameter itis, as it only has one possible value; gains parameter params that accepts further parameters to modify the search; changed parameter callopts to ....
  • Add many examples of using the params parameter in the bison() function.
  • Changed parameter callopts to ... in bison_providers().
  • Changed parameter callopts to ... in bison_tax().
  • In bison_solr(): BISONProviderID changed to providerID; BISONResourceID changed to resourceID; occurrence_date changed to eventDate; collector changed to recordedBy; gains parameters catalogNumber, ITIScommonName, kingdom, and verbose. Adde a bunch of examples.
  • Startup message contains reference to citation function.

rbison 0.3.2

  • Changed blanktheme() function to bison_blanktheme() to avoid namespace conflicts with the rgbif package.

rbison 0.3.0

  • Added a vignette.
  • bison() function gains "what" parameter, to allow selection of the type of data to get back. All data is returned from the API (As there is no way to select subsets of data), but the what parameter lets you discard the things you don't want, saving on memory.
  • bison() function gains "callopts" parameter to pass on curl options to httr::GET
  • bison() function gains "itis" parameter. Setting to TRUE allows searches on ITIS taxonomic serial numbers (TSNs)
  • bison() function gains "tsn" parameter. Specify a
  • New function bison_providers() to get metadata on data providers to BISON.
  • bison_data() function removed. This function was used to get data back from a call to bison() or bison_solr(). Now those two functions simply give the data back immediately.
  • A startup message added.

rbison 0.2.4

  • Pushed first version 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("rbison")

0.5.4 by Scott Chamberlain, 5 months ago


https://github.com/ropensci/rbison


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


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


Authors: Scott Chamberlain [aut, cre]


Documentation:   PDF Manual  


Task views:


MIT + file LICENSE license


Imports plyr, crul, ggplot2, mapproj, grid, sp, dplyr, jsonlite

Suggests roxygen2, knitr, testthat, taxize


Imported by spocc.


See at CRAN