ropensci / rredlist

IUCN Red List API Client
https://docs.ropensci.org/rredlist
Other
50 stars 15 forks source link

Problem to retrieve data of synonym #23

Closed FVFaleiro closed 7 years ago

FVFaleiro commented 7 years ago

The function "rl_search" do not retrieve data of synonym, but in the website is possible search the data. There is information about it in the API too (http://apiv3.iucnredlist.org/api/v3/docs#species-synonym). How can I handling it?

#Example: Synonym of _Loxodonta africana_ do not retrieve data
rl_search("Loxodonta cyclotis", key = IUCN_REDLIST_KEY)
sessionInfo()
R version 3.4.1 (2017-06-30)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 15063)

Matrix products: default

locale:
[1] LC_COLLATE=Portuguese_Brazil.1252  LC_CTYPE=Portuguese_Brazil.1252   
[3] LC_MONETARY=Portuguese_Brazil.1252 LC_NUMERIC=C                      
[5] LC_TIME=Portuguese_Brazil.1252    

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

other attached packages:
[1] rredlist_0.4.0

loaded via a namespace (and not attached):
[1] compiler_3.4.1  R6_2.2.2        curl_2.8.1      Rcpp_0.12.12   
[5] urltools_1.6.0  triebeard_0.3.0 crul_0.3.8      jsonlite_1.5   
sckott commented 7 years ago

thanks @FVFaleiro - First thing to note is that the Redlist website may not be consuming the same API we are using. Second, they may be using it, but then doing some extra work beyond what rl_search is doing. We don't know the status of either of these things.

I'd recommend doing eg., rl_synonyms("Loxodonta cyclotis") which finds the accepted name, then proceeding from there. Will that work for you?

FVFaleiro commented 7 years ago

This function solve my problem, thanks @sckott ! You do a great job in your packages! Cheers!

sckott commented 7 years ago

Glad it works, thx, and thanks for using the pkg and opening the issue

have a good one