-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
safely
execute functions like sci2comm
and comm2sci
#778
Comments
thanks for this @sastoudt having a look |
Those were good suggestions, but i swapped out the stop on nothing found line of code for just returning an empty result. Can you reinstall and try again? |
Thanks for taking a look so quickly! I re-installed and am getting an error (but a new one): birdNames = c( "stellers jay" , "common raven" , "american robin", "red-tailed hawk" )
test <- comm2sci(unique(birdNames))
No ENTREZ API key provided
Get one via taxize::use_entrez()
See https://ncbiinsights.ncbi.nlm.nih.gov/2017/11/02/new-api-keys-for-the-e-utilities/
══ 1 queries ═══════════════
Retrieving data for taxon 'stellers jay'
Not found. Consider checking the spelling or alternate classification
══ Results ═════════════════
● Total: 1
● Found: 0
● Not Found: 0
No ENTREZ API key provided
Get one via taxize::use_entrez()
See https://ncbiinsights.ncbi.nlm.nih.gov/2017/11/02/new-api-keys-for-the-e-utilities/
Error: Bad Request (HTTP 400) |
First, it's a good idea to get your own Entrez key. I dont think that's the issue here though. Did you make sure to restart your R session after installing the new version? Sorry to ask, but many people do not think to do this. |
Oops, you called it. I did forget to restart my R session. Now it works. Thanks! Can the same fix be made for |
great, glad it worked! i'll have a look at sci2comm |
Session Info
When trying to get scientific names for a vector of common names (or vice versa), one bad request ruins the whole function call.
Could the
purrr::safely
function be wrapped into the function calls to avoid this behavior? Or if you don't want to mess with the core functionality, providing an example of this work around in the documentation could be helpful.The text was updated successfully, but these errors were encountered: