-
Notifications
You must be signed in to change notification settings - Fork 7
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
Unable to run R scripts on Nature Serve API #30
Comments
Hi @mokezonline
In the second line, you need to replace "x" with "text". Interestingly the code returns a set of 20 results if "text" is missing. I'm not sure if that's the expected behavior or not. In the third line, you're missing the "results" part of the list object. Also the variable with the UID is 'uniqueId' not 'globalSpeciesUid. Let me know if this helps. Also, I heard you also emailed NatureServe with a version of this question. I'll let my colleagues know that we hopefully solved it here. |
Thank you so much for getting back to me, this helps a lot!
Cheers,
Zach
…On Thu, Feb 22, 2024 at 7:30 PM Christopher Tracey ***@***.***> wrote:
Hi @mokezonline <https://github.com/mokezonline>
Apologies for the delay in getting back to you. I believe that this is a
code issue, as I noticed a few inconsistences in your example script.
Here's my corrected version:
library(natserv)
gray.wolf.search <- ns_search_spp(text="Canis lupus")
gray.wolf.search$results$uniqueId
In the second line, you need to replace "x" with "text". Interestingly the
code returns a set of 20 results if "text" is missing. I'm not sure if
that's the expected behavior or not.
In the third line, you're missing the "results" part of the list object.
Also the variable with the UID is 'uniqueId' not 'globalSpeciesUid.
Let me know if this helps. Also, I heard you also emailed NatureServe with
a version of this question. I'll let my colleagues know that we hopefully
solved it here.
—
Reply to this email directly, view it on GitHub
<#30 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJPN7EHN3VHRWN7VTY4TIG3YU75M3AVCNFSM6AAAAABDMXX5XKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNRQGY2TEMBTGA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I just want to make sure that this is the right place to reference for the
nat_serve functions: https://github.com/ropensci/natserv/tree/master/R
On Sun, Mar 3, 2024 at 8:54 PM Zachary Cush ***@***.***>
wrote:
… Thank you so much for getting back to me, this helps a lot!
Cheers,
Zach
On Thu, Feb 22, 2024 at 7:30 PM Christopher Tracey <
***@***.***> wrote:
> Hi @mokezonline <https://github.com/mokezonline>
> Apologies for the delay in getting back to you. I believe that this is a
> code issue, as I noticed a few inconsistences in your example script.
> Here's my corrected version:
>
> library(natserv)
> gray.wolf.search <- ns_search_spp(text="Canis lupus")
> gray.wolf.search$results$uniqueId
>
> In the second line, you need to replace "x" with "text". Interestingly
> the code returns a set of 20 results if "text" is missing. I'm not sure if
> that's the expected behavior or not.
>
> In the third line, you're missing the "results" part of the list object.
> Also the variable with the UID is 'uniqueId' not 'globalSpeciesUid.
>
> Let me know if this helps. Also, I heard you also emailed NatureServe
> with a version of this question. I'll let my colleagues know that we
> hopefully solved it here.
>
> —
> Reply to this email directly, view it on GitHub
> <#30 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AJPN7EHN3VHRWN7VTY4TIG3YU75M3AVCNFSM6AAAAABDMXX5XKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNRQGY2TEMBTGA>
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>
|
Session Info
Install and load the natserv package from GitHub (if not already installed)
if (!requireNamespace("natserv", quietly = TRUE)) {
devtools::install_github("ropensci/natserv")
}
library(natserv)
gray.wolf.search <- ns_search_spp(x = "Canis lupus")
gray.wolf.search$globalSpeciesUid
Over repeated attempts I am consistently receiving a NULL output. I queried nature serve using postman via their example: explorer.natureserve.org/api/data/taxon/ELEMENT_GLOBAL.2.154701 HTTP/1.1
?Accept=application/json, just to see if I could get anything back, but it resulted in an internal server error code 500.
Is there something wrong with my code/query, or does this have something to do with Nature Serve servers being down?
Thanks!
The text was updated successfully, but these errors were encountered: