Skip to content
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

rl_habitats or rl_habitats_ ? #53

Closed
cpavloud opened this issue Sep 24, 2023 · 5 comments
Closed

rl_habitats or rl_habitats_ ? #53

cpavloud opened this issue Sep 24, 2023 · 5 comments

Comments

@cpavloud
Copy link

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

@willgearty
Copy link
Contributor

willgearty commented Sep 25, 2023

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

@cpavloud
Copy link
Author

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!

@willgearty
Copy link
Contributor

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.

@cpavloud
Copy link
Author

cpavloud commented Oct 4, 2023

Oh that's unfortunate. Thank you for asking!

@willgearty
Copy link
Contributor

willgearty commented Jan 3, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants