ropensci / rredlist

IUCN Red List API Client

Home Page:https://docs.ropensci.org/rredlist

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

rl_habitats or rl_habitats_ ?

cpavloud opened this issue · comments

Hello,

Could I ask what is the difference between rl_habitats and rl_habitats_ ?
Is the logic similar to the wm_attr_data and the wm_attr_data_ of the worrms package?
I would like to search for multiple species at once. I have extracted the species names in a (character) list, but it doesn't seem to work.
I get the error

Error: name must be length 1

both when I run

species_IUCN <- rl_habitats(species_list)

as well as when I run

species_IUCN <- rl_habitats_(species_list)

Also, how can I get a Redlist API key? I saw this issue #52 but I don't think it has been solved by now.

I am using R 4.1.1. and rredlist 0.7.1

Best,

Christina

Hi Christina,

As noted in the documentation and by the error that you are receiving, the first argument to rl_habitats() should be a single taxonomic name. Also, the difference between the normal and "_"-appended functions is documented here. In essence, the "_"-appended functions return the raw API data, whereas the normal functions convert that data to a data.frame (or list) for the user. Finally, I've reached out to the Red List team to inquire about the token generator page. Unfortunately, as I mentioned in issue #52, I am not a part of the Red List team and have no control over the API and their web pages.

Best,
Will

Ok, thank you.
So I will be using a for loop to search for all the species I have in my list, since the function works with one taxonomic name at a time.

I had gone through the documentation but I missed the phrase "The low level functions only do the HTTP request, and give back JSON without doing any more parsing."

Thank you very much for asking about the token generator!

Unfortunately, I received the following reply from the Red List team:

Thank you for your email and apologies for this issue. The API token request system is currently down. Unfortunately we don't have a timescale on when it might be possible to get it running again, and there is no other way to generate a token.

Oh that's unfortunate. Thank you for asking!

Closing this since the original issue was resolved. More details about API tokens can be found in the discussion in #52.