This repository has been archived by the owner on May 10, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathREADME.Rmd
183 lines (117 loc) · 5.54 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
rbison
======
```{r, eval=TRUE, echo=FALSE, include=FALSE}
knitr::opts_chunk$set(
fig.path = "man/figures/",
cache.path = "inst/readmecache/",
comment = "#>",
collapse = TRUE,
warning = FALSE,
message = FALSE
)
```
[![cran checks](https://cranchecks.info/badges/worst/rbison)](https://cranchecks.info/pkgs/rbison)
[![R-CMD-check](https://github.com/ropensci/rbison/workflows/R-CMD-check/badge.svg)](https://github.com/ropensci/rbison/actions/)
[![codecov.io](https://codecov.io/github/ropensci/rbison/coverage.svg?branch=master)](https://codecov.io/github/ropensci/rbison?branch=master)
[![rstudio mirror downloads](https://cranlogs.r-pkg.org/badges/rbison?color=E664A4)](https://github.com/metacran/cranlogs.app)
[![cran version](https://www.r-pkg.org/badges/version/rbison)](https://cran.r-project.org/package=rbison)
Wrapper for the USGS Bison (https://bison.usgs.gov) API
## Description
USGS Biodiversity Information Serving Our Nation (BISON) is a web-based federal mapping resource that provides access to georeferenced (those with latitude and longitude coordinates) and non-georeferenced data describing the occurrence or presence of terrestrial and aquatic species recorded or collected by a person (or instrument) at a specific time in the United States, U.S. Territories, U.S. Marine Exclusive Economic Zones (EEZs), and Canada. Each record in a species occurrence dataset available in BISON will typically consist of a scientific name (genus and specific epithet), a date, and one or more geographic references such as a state name, county name, and/or decimal latitude and longitude coordinates. In addition to these typical data fields, species occurrence datasets often include many other data fields that describe each species occurrence event in more detail.
BISON is the US Node of GBIF and regularly updates from GBIF to have full coverage and is committed to eventually providing most BISON originating data to GBIF, however, users should be aware that several million BISON records are not in GBIF. The Solr API for BISON is fully open with no limits, allowing full batch download, faceting and geospatial searches on both DC fields and BISON added fields such as the full ITIS taxonomy, FIPS Codes, and georeferencing of county records to documented centroids.
`rbison` allows one to pull species occurrence data from these datasets, inspect species occurance summaries, and then map species occurance within the US, within the contiguous 48 states, and/or at county or state level.
Current data providers for BISON can be found at https://bison.usgs.gov/providers.jsp
See https://bison.usgs.gov/doc/api.jsp for API docs for the BISON API.
## Installation
From CRAN
```{r eval=FALSE}
install.packages("rbison")
```
Or the development version from Github
```{r eval=FALSE}
remotes::install_github("ropensci/rbison")
```
Load package
```{r}
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.
## get data
```{r}
out <- bison(species = "Phocoenoides dalli dalli", count = 10)
```
### inspect summary
```{r}
out$summary
```
### map occurrences
```{r}
bisonmap(out)
```
## All points within the US (including AK and HI)
### get data
```{r}
out <- bison(species = "Cyanocitta stelleri", count = 500)
```
### inspect summary
```{r}
out$summary
```
### map occurrences
```{r}
bisonmap(out)
```
## All points within the contiguous 48 states
### get data
```{r cache=FALSE}
out <- bison(species = "Aquila chrysaetos", count = 300)
```
### inspect summary
```{r}
out$summary
```
### map occurrences
```{r}
bisonmap(out)
```
## Map county or state level data
### Counties - using last data call for Aquila
```{r}
bisonmap(out, tomap = "county")
```
### States - using last data call for Aquila
```{r}
bisonmap(out, tomap = "state")
```
## BISON SOLR interface
### taxa
The taxa service searches for and gives back taxonomic names
```{r}
bison_tax(query = "*bear")
```
And you can search by scientific name
```{r}
bison_tax(query = "Helianthus*", method = "scientificName")
```
### 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
```{r}
x <- bison_solr(scientificName = "Aquila chrysaetos", rows = 10,
fl = "scientificName,decimalLongitude,decimalLatitude")
x$points
```
Mapping the data
```{r}
out <- bison_solr(scientificName = "Aquila chrysaetos", rows = 1000)
bisonmap(out)
```
## Meta
* Please [report any issues or bugs](https://github.com/ropensci/rbison/issues).
* 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][coc]. 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 (https://github.com/ropensci/spocc), 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](https://ropensci.org/public_images/github_footer.png)](https://ropensci.org)
[coc]: https://github.com/ropensci/rbison/blob/master/CODE_OF_CONDUCT.md