The function bison() is sort of the main interface to searching for data in rbison, covered in the vignette rbison introduction. However, there are many other functions.

Load rbison

library('rbison')

Data provider statistics

BISON exposes an API supporting access to Data Provider and Resource based data access statistics.

out <- bison_stats(what='wms')
out$Arctos
#> $name
#> [1] "Arctos"
#> 
#> $resources
#> [1] "Bird tissues, Division of Genomic Resources, UNM, Albuquerque, NM."  
#> [2] "Fish tissues, Division of Genomic Resources, UNM, Albuquerque, NM."  
#> [3] "Harold W. Manter Laboratory of Parasitology Collection"              
#> [4] "Kenelm W. Philip lepidoptera collection"                             
#> [5] "KNWR Entomology Collection"                                          
#> [6] "KNWR Herbarium Collection"                                           
#> [7] "Mammal tissues, Division of Genomic Resources, UNM, Albuquerque, NM."
#> [8] "STAMP seabird egg collection"                                        
#> [9] "U. S. National Parasite Collection's holdings from Robert L. Rausch" 
#> 
#> $data
#> # A tibble: 54 x 23
#>    providerId resourceId lastUpdated todayTotals currentWeekTota…
#>    <chr>      <chr>      <lgl>             <int>            <int>
#>  1 177        177,973    NA                    0                0
#>  2 177        177,973    NA                    0                0
#>  3 177        177,973    NA                    0                0
#>  4 177        177,973    NA                    0                0
#>  5 177        177,973    NA                    0                0
#>  6 177        177,973    NA                    0                0
#>  7 177        177,988    NA                    0                0
#>  8 177        177,988    NA                    0                0
#>  9 177        177,988    NA                    0                0
#> 10 177        177,988    NA                    0                0
#> # … with 44 more rows, and 18 more variables: yesterdayTotals <int>,
#> #   lastWeekTotals <int>, janTotals <int>, febTotals <int>, marTotals <int>,
#> #   aprTotals <int>, mayTotals <int>, junTotals <int>, julTotals <int>,
#> #   augTotals <int>, sepTotals <int>, octTotals <int>, novTotals <int>,
#> #   decTotals <int>, currentMonthTotals <int>, resource <named list>, id <lgl>,
#> #   type <chr>
out$Harvard_University_Herbaria
#> $name
#> [1] "Harvard University Herbaria"
#> 
#> $resources
#> [1] "E.C. Smith Herbarium"        "Harvard University Herbaria"
#> 
#> $data
#> # A tibble: 12 x 23
#>    providerId resourceId lastUpdated todayTotals currentWeekTota…
#>    <chr>      <chr>      <lgl>             <int>            <int>
#>  1 214        214,1829   NA                    0                0
#>  2 214        214,1829   NA                    0                0
#>  3 214        214,1829   NA                    0                0
#>  4 214        214,1829   NA                    0                0
#>  5 214        214,1829   NA                    0                0
#>  6 214        214,1829   NA                    0                0
#>  7 214        214,202435 NA                    0             1148
#>  8 214        214,202435 NA                    0             1148
#>  9 214        214,202435 NA                    0             1148
#> 10 214        214,202435 NA                    0             1148
#> 11 214        214,202435 NA                    0             1148
#> 12 214        214,202435 NA                    0             1148
#> # … with 18 more variables: yesterdayTotals <int>, lastWeekTotals <int>,
#> #   janTotals <int>, febTotals <int>, marTotals <int>, aprTotals <int>,
#> #   mayTotals <int>, junTotals <int>, julTotals <int>, augTotals <int>,
#> #   sepTotals <int>, octTotals <int>, novTotals <int>, decTotals <int>,
#> #   currentMonthTotals <int>, resource <named list>, id <lgl>, type <chr>
out$ZooKeys
#> $name
#> [1] "ZooKeys"
#> 
#> $resources
#> [1] "Localities for the arachnid genus Acuclavella (Opiliones, Ceratolasmatidae)"                                                                                                             
#> [2] "Megophthalmidia_of_North_America"                                                                                                                                                        
#> [3] "USBombus, contemporary survey data of North American bumble bees (Hymenoptera,  Apidae, Bombus) distributed in the United States"                                                        
#> [4] "Western Palaearctic Ectoedemia (Zimmermannia) Hering and Ectoedemia Busck s. str. (Lepidoptera: Nepticulidae): five new species and new data on distribution, hostplants and recognition"
#> 
#> $data
#> # A tibble: 24 x 23
#>    providerId resourceId lastUpdated todayTotals currentWeekTota…
#>    <chr>      <chr>      <lgl>             <int>            <int>
#>  1 300        300,15002  NA                    0              402
#>  2 300        300,15002  NA                    0              402
#>  3 300        300,15002  NA                    0              402
#>  4 300        300,15002  NA                    0              402
#>  5 300        300,15002  NA                    0              402
#>  6 300        300,15002  NA                    0              402
#>  7 300        300,201848 NA                    0              402
#>  8 300        300,201848 NA                    0              402
#>  9 300        300,201848 NA                    0              402
#> 10 300        300,201848 NA                    0              402
#> # … with 14 more rows, and 18 more variables: yesterdayTotals <int>,
#> #   lastWeekTotals <int>, janTotals <int>, febTotals <int>, marTotals <int>,
#> #   aprTotals <int>, mayTotals <int>, junTotals <int>, julTotals <int>,
#> #   augTotals <int>, sepTotals <int>, octTotals <int>, novTotals <int>,
#> #   decTotals <int>, currentMonthTotals <int>, resource <named list>, id <lgl>,
#> #   type <chr>

Data provider information

head(bison_providers(provider_no=131))
#>           id
#> 1        131
#> 2  131,11420
#> 3    131,595
#> 4 131,202619
#> 5  131,14537
#> 6  131,14526
#>                                                                               name
#> 1    http //www.kahaku.go.jp/english/ National Museum of Nature and Science, Japan
#> 2                  Akita Prefectural Museum Hiroki Watanabe Collection of mollusca
#> 3                        Algae Collection of National Museum of Nature and Science
#> 4                     Annelida collection of National Museum of Nature and Science
#> 5 Arthropoda Collection of the Seto Marine Biological Laboratory, Kyoto University
#> 6   Bacteria Collection of the Seto Marine Biological Laboratory, Kyoto University
out <- bison_providers(details=TRUE)
out$National_Herbarium_of_New_South_Wales
#>                           provider_name
#> 1 National Herbarium of New South Wales
#> 2 National Herbarium of New South Wales
#>                                   provider_url                       name
#> 1 https://bison.usgs.gov/api/providers/details   NSW herbarium collection
#> 2 https://bison.usgs.gov/api/providers/details Plants of Papua New Guinea
#>        id                                         url
#> 1 126,968           http://plantnet.rbgsyd.nsw.gov.au
#> 2 126,969 http://plantnet.rbgsyd.nsw.gov.au/PNGplants

The Solr taxonomic name endpoint

Search for and collect taxonomic name data from the USGS Bison API using solr.

bison_tax(query="*bear")
#> $numFound
#> [1] 54
#> 
#> $names
#>         lc_vernacularName         vernacularName
#> 1     American black bear    American black bear
#> 2     American Black Bear    American Black Bear
#> 3        Asian Black Bear       Asian Black Bear
#> 4      Asiatic black bear     Asiatic black bear
#> 5       banded woollybear      banded woollybear
#> 6  Bear Canyon talussnail Bear Canyon talussnail
#> 7    Bear Creek slitmouth   Bear Creek slitmouth
#> 8              bear daisy             bear daisy
#> 9             bear flower            bear flower
#> 10            bear garlic            bear garlic
#> 
#> $highlight
#> NULL
#> 
#> $facets
#> NULL

Exact argument, here nothing found with latter call as *bear doesn’t exist, which makes sense

bison_tax(query="*bear", exact=FALSE)
#> $numFound
#> [1] 54
#> 
#> $names
#>         lc_vernacularName         vernacularName
#> 1     American black bear    American black bear
#> 2     American Black Bear    American Black Bear
#> 3        Asian Black Bear       Asian Black Bear
#> 4      Asiatic black bear     Asiatic black bear
#> 5       banded woollybear      banded woollybear
#> 6  Bear Canyon talussnail Bear Canyon talussnail
#> 7    Bear Creek slitmouth   Bear Creek slitmouth
#> 8              bear daisy             bear daisy
#> 9             bear flower            bear flower
#> 10            bear garlic            bear garlic
#> 
#> $highlight
#> NULL
#> 
#> $facets
#> NULL
bison_tax(query="*bear", exact=TRUE)
#> $numFound
#> [1] 49
#> 
#> $names
#>    lc_vernacularName   vernacularName
#> 1         bear daisy       bear daisy
#> 2        bear flower      bear flower
#> 3        bear garlic      bear garlic
#> 4           bear gum         bear gum
#> 5   bear huckleberry bear huckleberry
#> 6           bear oak         bear oak
#> 7         bear sedge       bear sedge
#> 8        bear tupelo      bear tupelo
#> 9         black bear       black bear
#> 10        brown bear       brown bear
#> 
#> $highlight
#> NULL
#> 
#> $facets
#> NULL

Using solr arguments (not all Solr arguments work). Return a certain number of rows

bison_tax(query="*bear", method="vernacularName", rows=3)
#> $numFound
#> [1] 54
#> 
#> $names
#>     lc_vernacularName      vernacularName
#> 1 American black bear American black bear
#> 2 American Black Bear American Black Bear
#> 3    Asian Black Bear    Asian Black Bear
#> 
#> $highlight
#> NULL
#> 
#> $facets
#> NULL

Return certain fields

bison_tax(query="*bear", method="vernacularName", fl='vernacularName')
#> $numFound
#> [1] 54
#> 
#> $names
#>            vernacularName
#> 1     American black bear
#> 2     American Black Bear
#> 3        Asian Black Bear
#> 4      Asiatic black bear
#> 5       banded woollybear
#> 6  Bear Canyon talussnail
#> 7    Bear Creek slitmouth
#> 8              bear daisy
#> 9             bear flower
#> 10            bear garlic
#> 
#> $highlight
#> NULL
#> 
#> $facets
#> NULL

The solr occurrence data endpoint

Search for and collect occurrence data from the USGS Bison API using their solr endpoint.

bison_solr(scientificName='Ursus americanus', computedStateFips='02',
 fl="scientificName", rows=3)
#> $num_found
#> [1] 2464
#> 
#> $points
#>     scientificName
#> 1 Ursus americanus
#> 2 Ursus americanus
#> 3 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"
bison_solr(scientificName='Ursus americanus', computedStateFips='02',
 rows=3, fl="scientificName,decimalLongitude,decimalLatitude")
#> $num_found
#> [1] 2464
#> 
#> $points
#>   decimalLongitude   scientificName decimalLatitude
#> 1          -136.87 Ursus americanus           58.45
#> 2          -136.16 Ursus americanus           59.05
#> 3          -157.15 Ursus americanus           57.90
#> 
#> $highlight
#> NULL
#> 
#> $facets
#> $facets$facet_queries
#> NULL
#> 
#> $facets$facet_fields
#> NULL
#> 
#> $facets$facet_dates
#> NULL
#> 
#> $facets$facet_ranges
#> NULL
#> 
#> 
#> attr(,"class")
#> [1] "bison_solr"
bison_solr(TSNs = 174670, rows=2)$points[,1:6]
#>    eventDate providedScientificName year countryCode ambiguous     latlon
#> 1 2016-09-16         Pelecaniformes 2016          US     FALSE -81.3,28.6
#> 2       <NA>         Pelecaniformes   NA          US     FALSE       <NA>
bison_solr(kingdom = "Plantae", rows=2)$points[,1:6]
#>    providedScientificName countryCode providedCounty ambiguous
#> 1 Quercus michauxii Nutt.          US         Putnam     FALSE
#> 2    Iris hexagona Walter          US         Putnam     FALSE
#>                   latlon computedCountyFips
#> 1 -81.7408939,29.6060059              12107
#> 2 -81.7408939,29.6060059              12107

Using additional solr fields - Faceting

bison_solr(scientificName='Helianthus annuus', rows=0, facet='true',
 facet.field='computedStateFips')
#> $num_found
#> [1] 10442
#> 
#> $points
#> NULL
#> 
#> $highlight
#> NULL
#> 
#> $facets
#> $facets$facet_queries
#> NULL
#> 
#> $facets$facet_fields
#> $facets$facet_fields$computedStateFips
#>    X1   X2
#> 1  06 2444
#> 2  48 1336
#> 3  08  568
#> 4  20  496
#> 5  35  440
#> 6  04  359
#> 7  46  292
#> 8  30  233
#> 9  49  230
#> 10 31  211
#> 11 16  206
#> 12 29  186
#> 13 41  178
#> 14 38  164
#> 15 56  163
#> 16 53  148
#> 17 17  138
#> 18 32  130
#> 19 40  121
#> 20 19   78
#> 21 25   61
#> 22 12   54
#> 23 22   54
#> 24 26   49
#> 25 SK   48
#> 26 39   43
#> 27 55   41
#> 28 05   40
#> 29 27   40
#> 30 36   40
#> 31 09   38
#> 32 47   37
#> 33 37   35
#> 34 AB   34
#> 35 18   33
#> 36 23   33
#> 37 BC   31
#> 38 21   28
#> 39 42   25
#> 40 45   23
#> 41 34   22
#> 42 54   21
#> 43 33   18
#> 44 24   17
#> 45 ON   17
#> 46 50   15
#> 47 MB   14
#> 48 02   11
#> 49 28   11
#> 50 13    9
#> 51 11    7
#> 52 44    7
#> 53 01    6
#> 54 15    6
#> 55 NS    5
#> 56 10    4
#> 57 51    4
#> 58 NB    4
#> 59 QC    4
#> 60 72    1
#> 61 60    0
#> 62 66    0
#> 63 69    0
#> 64 78    0
#> 65 NL    0
#> 66 NT    0
#> 67 NU    0
#> 68 PE    0
#> 69 YT    0
#> 
#> 
#> $facets$facet_dates
#> NULL
#> 
#> $facets$facet_ranges
#> NULL
#> 
#> 
#> attr(,"class")
#> [1] "bison_solr"

Highlighting

bison_solr(scientificName='Helianthus annuus', rows=1, hl='true',
 hl.fl='scientificName')
#> $num_found
#> [1] 10442
#> 
#> $points
#>   establishmentMeans providedScientificName countryCode providedCounty
#> 1             AK  HI   Helianthus annuus L.          US          Perry
#>   ambiguous                 latlon computedCountyFips occurrenceID
#> 1     FALSE -82.2379525,39.7431874              39127   2070186925
#>   decimalLongitude basisOfRecord                           collectionID
#> 1        -82.23795      specimen http://plants.usda.gov/java/citePlants
#>   ownerInstitutionCollectionCode    scientificName          institutionID
#> 1         USDA - PLANTS Database Helianthus annuus https://bison.usgs.gov
#>   computedStateFips                                                    license
#> 1                39 http://creativecommons.org/publicdomain/zero/1.0/legalcode
#>    TSNs providerID stateProvince higherGeographyID decimalLatitude
#> 1 36616        440          Ohio             39127        39.74319
#>                      geo provider calculatedCounty ITISscientificName
#> 1 -82.2379525 39.7431874    BISON            Perry  Helianthus annuus
#>                          pointPath kingdom calculatedState
#> 1 /-82.2379525,39.7431874/specimen Plantae            Ohio
#>                                                           hierarchy_homonym_string
#> 1 -202422-954898-846494-954900-846496-846504-18063-846535-35419-35420-36611-36616-
#>                                               ITIScommonName resourceID ITIStsn
#> 1 annual sunflower;common sunflower;sunflower;wild sunflower   440,1066   36616
#> 
#> $highlight
#> $highlight$`2070186925`
#> $highlight$`2070186925`$scientificName
#> $highlight$`2070186925`$scientificName[[1]]
#> [1] "<em>Helianthus annuus</em>"
#> 
#> 
#> 
#> 
#> $facets
#> $facets$facet_queries
#> NULL
#> 
#> $facets$facet_fields
#> NULL
#> 
#> $facets$facet_dates
#> NULL
#> 
#> $facets$facet_ranges
#> NULL
#> 
#> 
#> attr(,"class")
#> [1] "bison_solr"