'spocc' - species name not matching when using "idigbio"

I’m trying to retrieve species occurrence using the R package spocc. When I include from = 'idigbio' the species name that are returned do not match the species name that I submitted. Here is an example using only three species:

Retrieving data from gbif, bison, and ecoengine with the occ function

spnames<-c('Lindsaea lancea', 'Adiantum tomentosum', 'Trichomanes elegans')

df <- occ(query = spnames, from = c('gbif', 'bison', 'ecoengine'),
          gbifopts = list(limit = 100, hasCoordinate=TRUE, basisOfRecord = 'PRESERVED_SPECIMEN', hasGeospatialIssue = FALSE), 
          ecoengineopts = list(limit = 100, basisofRecord = 'specimen'),
          bisonopts = list(limit = 100, basisOfRecord = 'specimen'),
          geometry = c(-81,-22,-40,10)) 

out<-occ2df(df)
unique(out$name)
> unique(out$name)
[1] "Lindsaea lancea"     "Adiantum tomentosum" "Trichomanes elegans" 

Retrieving data from idigbio with occ

df1 <- occ(query = spnames, from = 'idigbio',
           idigbioopts = list(limit = 100, basisOfRecord = 'specimen'),
          geometry = c(-81,-22,-40,10))  # This returns 100 different names (not synonyms)

Retrieving data from idigbio with idig_search_records (package ridigbio)

ff<-idig_search_records(rq=list(scientificname=spnames), limit=100)
unique(ff$scientificname)

[1] "lindsaea lancea"     "adiantum tomentosum" "trichomanes elegans"

Any idea why occ is not returning the correct species when searching idigbio?

Many thanks!

Thanks for your question!

Can you paste in the output of devtools::session_info() or sessionInfo() so I can see what package versions you have, thanks!

Hi Scott,

Thank you for looking at it. Here is the output of devtools::session_info()

Cheers,

devtools::session_info()
Session info --------------------------------------------------------------------------------------------------------------
setting value
version R version 3.2.3 (2015-12-10)
system x86_64, mingw32
ui RStudio (0.99.892)
language (EN)
collate English_United States.1252
tz Europe/Berlin
date 2016-07-01

Packages ------------------------------------------------------------------------------------------------------------------
package * version date source
assertthat 0.1 2013-12-06 CRAN (R 3.2.4)
brew 1.0-6 2011-04-13 CRAN (R 3.2.3)
chron 2.3-47 2015-06-24 CRAN (R 3.2.4)
colorspace 1.2-6 2015-03-11 CRAN (R 3.2.4)
curl 0.9.7 2016-04-10 CRAN (R 3.2.5)
data.table 1.9.6 2015-09-19 CRAN (R 3.2.5)
DBI 0.4-1 2016-05-08 CRAN (R 3.2.5)
devtools 1.10.0 2016-01-23 CRAN (R 3.2.4)
digest 0.6.9 2016-01-08 CRAN (R 3.2.4)
dplyr 0.5.0 2016-06-24 CRAN (R 3.2.5)
fields 8.4-1 2016-05-05 CRAN (R 3.2.5)
foreign 0.8-66 2015-08-19 CRAN (R 3.2.3)
geoaxe 0.1.0 2016-02-19 CRAN (R 3.2.5)
geosphere 1.5-1 2015-12-18 CRAN (R 3.2.4)
ggmap 2.6.1 2016-01-23 CRAN (R 3.2.5)
ggplot2 * 2.1.0 2016-03-01 CRAN (R 3.2.4)
gistr 0.3.6 2015-12-22 CRAN (R 3.2.5)
gtable 0.2.0 2016-02-26 CRAN (R 3.2.4)
htmltools 0.3.5 2016-03-21 CRAN (R 3.2.5)
httr 1.2.0 2016-06-15 CRAN (R 3.2.5)
jpeg 0.1-8 2014-01-23 CRAN (R 3.2.3)
jsonlite 0.9.22 2016-06-15 CRAN (R 3.2.5)
knitr 1.13 2016-05-09 CRAN (R 3.2.5)
labeling 0.3 2014-08-23 CRAN (R 3.2.3)
lattice 0.20-33 2015-07-14 CRAN (R 3.2.3)
lazyeval 0.2.0 2016-06-12 CRAN (R 3.2.5)
leafletR 0.4-0 2016-04-01 CRAN (R 3.2.5)
lubridate 1.5.6 2016-04-06 CRAN (R 3.2.5)
magrittr 1.5 2014-11-22 CRAN (R 3.2.4)
mapproj 1.2-4 2015-08-03 CRAN (R 3.2.5)
maps * 3.1.0 2016-02-13 CRAN (R 3.2.4)
maptools 0.8-39 2016-01-30 CRAN (R 3.2.5)
memoise 1.0.0 2016-01-29 CRAN (R 3.2.4)
munsell 0.4.3 2016-02-13 CRAN (R 3.2.4)
oai 0.2.0 2016-02-06 CRAN (R 3.2.4)
plyr 1.8.3 2015-06-12 CRAN (R 3.2.5)
png 0.1-7 2013-12-03 CRAN (R 3.2.3)
proto 0.3-10 2012-12-22 CRAN (R 3.2.3)
R6 2.1.2 2016-01-26 CRAN (R 3.2.4)
rbison 0.4.8 2015-07-02 CRAN (R 3.2.5)
RColorBrewer 1.1-2 2014-12-07 CRAN (R 3.2.3)
Rcpp 0.12.5 2016-05-14 CRAN (R 3.2.5)
rebird 0.3.0 2016-03-23 CRAN (R 3.2.5)
reshape2 1.4.1 2014-12-06 CRAN (R 3.2.4)
rgbif 0.9.3 2016-03-29 CRAN (R 3.2.5)
rgeos 0.3-19 2016-04-04 CRAN (R 3.2.5)
RgoogleMaps 1.2.0.7 2015-01-21 CRAN (R 3.2.5)
ridigbio * 0.3.3 2016-01-12 CRAN (R 3.2.5)
rjson 0.2.15 2014-11-03 CRAN (R 3.2.3)
RJSONIO 1.3-0 2014-07-28 CRAN (R 3.2.3)
rmarkdown 0.9.6 2016-05-01 CRAN (R 3.2.5)
rvertnet 0.4.4 2016-04-14 CRAN (R 3.2.5)
rworldmap 1.3-6 2016-02-03 CRAN (R 3.2.5)
scales 0.4.0 2016-02-26 CRAN (R 3.2.4)
sp 1.2-3 2016-04-14 CRAN (R 3.2.5)
spam 1.3-0 2015-10-29 CRAN (R 3.2.5)
spocc * 0.5.0 2016-04-23 CRAN (R 3.2.5)
spoccutils * 0.1.0 2015-07-07 CRAN (R 3.2.5)
stringi 1.1.1 2016-05-27 CRAN (R 3.2.5)
stringr 1.0.0 2015-04-30 CRAN (R 3.2.4)
tibble 1.0 2016-03-23 CRAN (R 3.2.5)
V8 1.0.3 2016-06-28 CRAN (R 3.2.5)
whisker 0.3-2 2013-04-28 CRAN (R 3.2.4)
xml2 1.0.0 2016-06-24 CRAN (R 3.2.5)

@justropp

Reinstall from github devtools::install_github("ropensci/spocc") - it should work now - there was a wee bug in the idigbio internal function - but is fixed now, let me know if it works for you after reinstall

Great! Yes, it is working after reinstalling.

1 Like

good, glad to hear it’s working