BISON USGS species occurrence data

[This article was first published on Recology - R, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

The USGS recently released a way to search for and get species occurrence records for the USA. The service is called BISON (Biodiversity Information Serving Our Nation). The service has a web interface for human interaction in a browser, and two APIs (application programming interface) to allow machines to interact with their database. One of the APIs allows you to search and retrieve data, and the other gives back maps as either a heatmap or a species occurrence map. The latter is more appropriate for working in a browser, so I’ll leave that to the web app folks.

The Core Science Analytics and Synthesis (CSAS) program of the US Geological Survey are responsible for BISON, and are the US node of the Global Biodiversity Information Facility (GBIF). BISON data is nested within that of GBIF, but has (or wil have?) additional data not in GBIF, as described on their About page:

BISON has been initiated with the 110 million records GBIF makes available from the U.S. and is integrating millions more records from other sources each year

Have a look at their Data providers and Statistics tabs on the BISON website, which list where data comes from and how many searches and downloads have been done on each data provider.

We (rOpenSci) started an R package to interact with the BISON search API >> rbison. You may be thinking, but if the data in BISON is also in GBIF, why both making another R package for BISON? Good question. As I just said, BISON will have some data GBIF won’t have. Also, the services (search API and map service) are different than those of GBIF.

Check out the package on GitHub here https://github.com/ropensci/rbison.

Here is a quick run through of some things you can do with rbison.


Install ribson

<span class="c1"># Install rbison from GitHub using devtools, uncomment to install</span>
<span class="c1"># install.packages('devtools') library(devtools) install_github('rbison',</span>
<span class="c1"># 'ropensci')</span>
library<span class="p">(</span>rbison<span class="p">)</span>

Search the BISON database for, of course, bison

<span class="c1"># Do the search</span>
out <span class="o"><-</span> bison<span class="p">(</span>species <span class="o">=</span> <span class="s">"Bison bison"</span><span class="p">,</span> type <span class="o">=</span> <span class="s">"scientific_name"</span><span class="p">,</span> start <span class="o">=</span> <span class="m">0</span><span class="p">,</span> count <span class="o">=</span> <span class="m">10</span><span class="p">)</span>

<span class="c1"># Check that the returned object is the right class ('bison')</span>
class<span class="p">(</span>out<span class="p">)</span>
[1] "bison"

Get a summary of the data

bison_data<span class="p">(</span>out<span class="p">)</span>
  total observation fossil specimen unknown
1   761          30      4      709      18

Summary by counties (just the first 6 rows)

head<span class="p">(</span>bison_data<span class="p">(</span>input <span class="o">=</span> out<span class="p">,</span> datatype <span class="o">=</span> <span class="s">"counties"</span><span class="p">))</span>
  record_id total county_name      state
1     48295     7    Lipscomb      Texas
2     41025    15      Harney     Oregon
3     49017     8    Garfield       Utah
4     35031     2    McKinley New Mexico
5     56013     1     Fremont    Wyoming
6     40045     2       Ellis   Oklahoma

Summary of states

bison_data<span class="p">(</span>input <span class="o">=</span> out<span class="p">,</span> datatype <span class="o">=</span> <span class="s">"states"</span><span class="p">)</span>
      record_id total county_fips
1    Washington     1          53
2         Texas     8          48
3    New Mexico     8          35
4          Iowa     1          19
5       Montana     9          30
6       Wyoming   155          56
7        Oregon    15          41
8      Oklahoma    14          40
9        Kansas    10          20
10      Arizona     1          04
11       Alaska    29          02
12         Utah    16          49
13     Colorado    17          08
14     Nebraska     1          31
15 South Dakota    61          46

Map the results

<span class="c1"># Search for Ursus americanus (american black bear)</span>
out <span class="o"><-</span> bison<span class="p">(</span>species <span class="o">=</span> <span class="s">"Ursus americanus"</span><span class="p">,</span> type <span class="o">=</span> <span class="s">"scientific_name"</span><span class="p">,</span> start <span class="o">=</span> <span class="m">0</span><span class="p">,</span> 
    count <span class="o">=</span> <span class="m">200</span><span class="p">)</span>

<span class="c1"># Sweet, got some data</span>
bison_data<span class="p">(</span>out<span class="p">)</span>
  total observation fossil specimen literature unknown centroid
1  3792          59    125     3522         47      39       78

Make some maps! Note that right now the county and state maps just plot the conterminous lower 48. The map of individual occurrences shows the lower 48 + Alaska

<span class="c1"># By county</span>
bisonmap<span class="p">(</span>out<span class="p">,</span> tomap <span class="o">=</span> <span class="s">"county"</span><span class="p">)</span>

center

<span class="c1"># By state</span>
bisonmap<span class="p">(</span>out<span class="p">,</span> tomap <span class="o">=</span> <span class="s">"state"</span><span class="p">)</span>

center

<span class="c1"># Individual locations</span>
bisonmap<span class="p">(</span>out<span class="p">)</span>
## Rendering map...plotting 199 points

center


When plotting occurrences, you can pass additional arguments into the bisonmap function.

For example, you can jitter the points

bisonmap<span class="p">(</span>input <span class="o">=</span> out<span class="p">,</span> geom <span class="o">=</span> geom_jitter<span class="p">)</span>
## Rendering map...plotting 199 points

center

And you can specify by how much you want the points to jitter (here an extreme example to make it obvious)

library<span class="p">(</span>ggplot2<span class="p">)</span>
bisonmap<span class="p">(</span>input <span class="o">=</span> out<span class="p">,</span> geom <span class="o">=</span> geom_jitter<span class="p">,</span> jitter <span class="o">=</span> position_jitter<span class="p">(</span>width <span class="o">=</span> <span class="m">5</span><span class="p">))</span>
## Rendering map...plotting 199 points

center


Let us know if you have any feature requests or find bugs at our GitHub Issues page.

To leave a comment for the author, please follow the link and comment on their blog: Recology - R.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)