ropensci / spocc

Species occurrence data toolkit for R
https://docs.ropensci.org/spocc
Other
116 stars 27 forks source link

e-bird Key #229

Closed Tai-Rocha closed 3 years ago

Tai-Rocha commented 4 years ago

Hi, when I try get occurrence from ebird I receive this message . Is is possible to pass this key in the occ function?

Warning messages:
1: ebird: No records returned in eBird for Schiffornis turdina 
2: ebird: You must provide an API key from eBird.
    You can pass it to the 'key' argument or store it as 
    an environment variable called EBIRD_KEY in your .Renviron file.
    If you don't have a key, you can obtain one from:
    https://ebird.org/api/keygen. 

sckott commented 4 years ago

this should work :

occ("Schiffornis turdina", from = "ebird", ebirdopts = list(key = "your key"))
Tai-Rocha commented 4 years ago

Thank you for your prompt reply! This command It seems ok , but I tried this for 3 species and any records can not be found... bUt i know that they are in e-bird.

Warning messages: 1: ebird: No records returned in eBird for Schiffornis turdina 2: ebird:

Thanks

sckott commented 4 years ago

ebird search is a bit funky. we need to search only within a single country at a time. the default country is the us just since that's where i'm based, but you can change it like this by giving a 2 letter country code to ebirdopts parameter:

x <- occ('Schiffornis turdina', from = 'ebird', ebirdopts = list(loc='BR'))
x$ebird
#> Species [Schiffornis turdina (1)]
#> First 10 rows of [Schiffornis_turdina]
#> 
#> # A tibble: 1 x 14
#>   name                longitude latitude prov  speciesCode comName                  locId    locName                 obsDt      howMany obsValid obsReviewed locationPrivate subId
#>   <chr>                   <dbl>    <dbl> <chr> <chr>       <chr>                    <chr>    <chr>                   <date>       <int> <lgl>    <lgl>       <lgl>           <chr>
#> 1 Schiffornis turdina     -55.9    -9.54 ebird thlsch3     Brown-winged Schiffornis L2349885 Cristalino Lodge--Limão 2020-08-02       3 TRUE     FALSE       FALSE           S720491
Tai-Rocha commented 4 years ago

Thanks a lot =)