bisonopts being ignored?

Tags: #<Tag:0x00007f57f92802f0>



Dipping back in here again because I noticed that the bisonopts parameter appear to be disabled or ignored in the spocc::occ and rbison::bison functions. Below are example scripts comparing species results between spocc and rbison. Hopefully I’m making an accurate comparison. Seems like it’s not just restricted to the countryCode param either, saw the same thing for stateProvince, year, and other params.

occ(query = “Populus tremuloides”, from = “bison”, limit=1, bisonopts = list(params=‘countryCode: US’)) 739240 records

occ(query = “Populus tremuloides”, from = “bison”, limit=1, bisonopts = list(params=‘countryCode: CA’))
739240 records

bison(species = “Populus tremuloides”, params = ‘countryCode: US’, count = 1)
738280 records

bison(species = “Populus tremuloides”, params = ‘countryCode: CA’, count = 1)
738280 records

R version 3.5.1 (2018-07-02)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

Matrix products: default

[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C LC_TIME=English_United States.1252

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] rbison_0.7.0 spocc_0.8.0 - but saw the same results after installing the latest builds from Github


Thanks for your question @PEngelstad

So a few things.

  1. we use rbison::bison_solr() internally by default as it’s more flexible than rbison::bison - you can still do countryCode but do it as occ(..., bisonopts = list(countryCode = "CA"))
  2. you can see what HTTP request is being sent by doing occ(..., callopts=list(verbose=TRUE)) which prints the HTTP request information to the R console - this often helps diagnose problems

let me know if that helps.

I will document better in spocc when we use rbison::bison_solr and when we use rbison::bison


Yes, both those suggestions help tremendously. I figured I just wasn’t getting the formatting right on the bisonopts call and that does the trick. As always, thanks for the speedy reply!


cool, glad it helps. thanks for finding a hole in our documentation.