Giter Club home page Giter Club logo

rebird's Introduction

rebird: wrapper to the eBird API

Project Status: Active – The project has reached a stable, usable state and is being actively developed. R-CMD-check Codecov test coverage rstudio mirror downloads cran version

rebird is a package to interface with the eBird webservices.

eBird is a real-time, online bird checklist program. For more information, visit their website: https://ebird.org/home

The API for the eBird webservices can be accessed here: https://documenter.getpostman.com/view/664302/S1ENwy59?version=latest

Install

You can install the stable version from CRAN

install.packages("rebird")

Or the development version from Github

install.packages("devtools")
devtools::install_github("ropensci/rebird")

Direct use of rebird

Load the package:

library("rebird")

The eBird API server requires users to provide an API key, which is linked to your eBird user account. You can pass it to the ‘key’ argument in rebird functions, but we highly recommend storing 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.

You can keep your .Renviron file in your global R home directory (R.home()), your user’s home directory (Sys.getenv("HOME")), or your current working directory (getwd()). Remember that .Renviron is loaded once when you start R, so if you add your API key to the file you will have to restart your R session. See ?Startup for more information on R’s startup files.

Furthermore, functions now use species codes, rather than scientific names, for species-specific requests. We’ve made the switch easy by providing the species_code function, which converts a scientific name to its species code:

species_code('sula variegata')
#> Peruvian Booby (Sula variegata): perboo1
#> [1] "perboo1"

The species_code function can be called within other rebird functions, or the species code can be specified directly.

eBird Taxonomy

The eBird taxonomy is internally stored in rebird and can be called using

rebird::tax
#> # A tibble: 17,064 × 15
#>    sciName     comName speciesCode category taxonOrder bandingCodes comNameCodes
#>    <chr>       <chr>   <chr>       <chr>         <dbl> <chr>        <chr>       
#>  1 Struthio c… Common… ostric2     species           2 <NA>         COOS        
#>  2 Struthio m… Somali… ostric3     species           7 <NA>         SOOS        
#>  3 Struthio c… Common… y00934      slash             8 <NA>         SOOS,COOS   
#>  4 Rhea ameri… Greate… grerhe1     species          10 <NA>         GRRH        
#>  5 Rhea penna… Lesser… lesrhe2     species          16 <NA>         LERH        
#>  6 Rhea penna… Lesser… lesrhe4     issf             17 <NA>         LERH        
#>  7 Rhea penna… Lesser… lesrhe3     issf             20 <NA>         LERH        
#>  8 Nothocercu… Tawny-… tabtin1     species          22 <NA>         TBTI        
#>  9 Nothocercu… Highla… higtin1     species          23 HITI         <NA>        
#> 10 Nothocercu… Highla… higtin2     issf             24 <NA>         HITI        
#> # ℹ 17,054 more rows
#> # ℹ 8 more variables: sciNameCodes <chr>, order <chr>, familyCode <chr>,
#> #   familyComName <chr>, familySciName <chr>, reportAs <chr>, extinct <lgl>,
#> #   extinctYear <int>

While the internal taxonomy is kept up to date with each package release, it could be outdated if a new taxonomy is made available before the package is updated. You can obtain the latest eBird taxonomy by

new_tax <- ebirdtaxonomy()

Sightings at location determined by latitude/longitude

Search for bird occurrences by latitude and longitude point

ebirdgeo(species = species_code('spinus tristis'), lat = 42, lng = -76)
#> American Goldfinch (Spinus tristis): amegfi
#> # A tibble: 31 × 13
#>    speciesCode comName  sciName locId locName obsDt howMany   lat   lng obsValid
#>    <chr>       <chr>    <chr>   <chr> <chr>   <chr>   <int> <dbl> <dbl> <lgl>   
#>  1 amegfi      America… Spinus… L144… Heart … 2024…      10  41.8 -75.8 TRUE    
#>  2 amegfi      America… Spinus… L982… Hazel … 2024…       1  42.1 -76.1 TRUE    
#>  3 amegfi      America… Spinus… L243… 71 Wil… 2024…      12  42.2 -75.9 TRUE    
#>  4 amegfi      America… Spinus… L124… Happy … 2024…       7  42.1 -75.9 TRUE    
#>  5 amegfi      America… Spinus… L197… esther… 2024…       4  42.1 -75.9 TRUE    
#>  6 amegfi      America… Spinus… L299… 184 Sw… 2024…       4  42.2 -76.0 TRUE    
#>  7 amegfi      America… Spinus… L300… 194 Sw… 2024…       6  42.2 -75.9 TRUE    
#>  8 amegfi      America… Spinus… L210… 1099 P… 2024…       2  42.1 -76.0 TRUE    
#>  9 amegfi      America… Spinus… L131… Vestal  2024…       1  42.1 -76.1 TRUE    
#> 10 amegfi      America… Spinus… L447… Bingha… 2024…       2  42.1 -76.0 TRUE    
#> # ℹ 21 more rows
#> # ℹ 3 more variables: obsReviewed <lgl>, locationPrivate <lgl>, subId <chr>

Recent observations at a region

Search for bird occurrences by region and species name

ebirdregion(loc = 'US', species = 'btbwar')
#> # A tibble: 15 × 13
#>    speciesCode comName sciName locId locName obsDt howMany   lat    lng obsValid
#>    <chr>       <chr>   <chr>   <chr> <chr>   <chr>   <int> <dbl>  <dbl> <lgl>   
#>  1 btbwar      Black-… Setoph… L129… Cave C… 2024…       1  31.9 -109.  TRUE    
#>  2 btbwar      Black-… Setoph… L584… Treasu… 2024…       1  27.8  -80.4 TRUE    
#>  3 btbwar      Black-… Setoph… L300… 11300 … 2024…       1  27.8  -80.4 TRUE    
#>  4 btbwar      Black-… Setoph… L127… Lettuc… 2024…       1  28.1  -82.4 TRUE    
#>  5 btbwar      Black-… Setoph… L195… 1 My H… 2024…       1  27.0  -80.1 TRUE    
#>  6 btbwar      Black-… Setoph… L582… Southe… 2024…       1  25.4  -80.6 TRUE    
#>  7 btbwar      Black-… Setoph… L661… Memori… 2024…       1  29.6  -95.6 TRUE    
#>  8 btbwar      Black-… Setoph… L214… Saxapa… 2024…       1  35.9  -79.3 TRUE    
#>  9 btbwar      Black-… Setoph… L149… Jackso… 2024…       1  30.3  -81.5 TRUE    
#> 10 btbwar      Black-… Setoph… L127… Key We… 2024…       2  24.6  -81.7 TRUE    
#> 11 btbwar      Black-… Setoph… L127… Key La… 2024…       1  25.2  -80.4 TRUE    
#> 12 btbwar      Black-… Setoph… L385… My Yard 2024…       1  25.7  -80.3 TRUE    
#> 13 btbwar      Black-… Setoph… L823… J. N. … 2024…       1  26.5  -82.1 TRUE    
#> 14 btbwar      Black-… Setoph… L682… Univer… 2024…       1  25.7  -80.3 TRUE    
#> 15 btbwar      Black-… Setoph… L130… Castle… 2024…       1  29.6  -81.2 TRUE    
#> # ℹ 3 more variables: obsReviewed <lgl>, locationPrivate <lgl>, subId <chr>

Recent observations at hotspots

Search for bird occurrences by a given hotspot

ebirdregion(loc = 'L99381')
#> # A tibble: 62 × 14
#>    speciesCode comName  sciName locId locName obsDt howMany   lat   lng obsValid
#>    <chr>       <chr>    <chr>   <chr> <chr>   <chr>   <int> <dbl> <dbl> <lgl>   
#>  1 gadwal      Gadwall  Mareca… L993… Stewar… 2024…       6  42.5 -76.5 TRUE    
#>  2 amewig      America… Mareca… L993… Stewar… 2024…       2  42.5 -76.5 TRUE    
#>  3 mallar3     Mallard  Anas p… L993… Stewar… 2024…      25  42.5 -76.5 TRUE    
#>  4 ambduc      America… Anas r… L993… Stewar… 2024…       2  42.5 -76.5 TRUE    
#>  5 commer      Common … Mergus… L993… Stewar… 2024…       6  42.5 -76.5 TRUE    
#>  6 killde      Killdeer Charad… L993… Stewar… 2024…       2  42.5 -76.5 TRUE    
#>  7 ribgul      Ring-bi… Larus … L993… Stewar… 2024…      NA  42.5 -76.5 TRUE    
#>  8 gbbgul      Great B… Larus … L993… Stewar… 2024…      NA  42.5 -76.5 TRUE    
#>  9 doccor      Double-… Nannop… L993… Stewar… 2024…       2  42.5 -76.5 TRUE    
#> 10 amecro      America… Corvus… L993… Stewar… 2024…       4  42.5 -76.5 TRUE    
#> # ℹ 52 more rows
#> # ℹ 4 more variables: obsReviewed <lgl>, locationPrivate <lgl>, subId <chr>,
#> #   exoticCategory <chr>

Nearest observations of a species

Search for a species’ occurrences near a given latitude and longitude

nearestobs(species_code('branta canadensis'), 42, -76)
#> Canada Goose (Branta canadensis): cangoo
#> # A tibble: 67 × 13
#>    speciesCode comName  sciName locId locName obsDt howMany   lat   lng obsValid
#>    <chr>       <chr>    <chr>   <chr> <chr>   <chr>   <int> <dbl> <dbl> <lgl>   
#>  1 cangoo      Canada … Branta… L179… "Bingh… 2024…       2  42.1 -75.9 TRUE    
#>  2 cangoo      Canada … Branta… L144… "Heart… 2024…       2  41.8 -75.8 TRUE    
#>  3 cangoo      Canada … Branta… L116… "Lake … 2024…       2  41.8 -75.9 TRUE    
#>  4 cangoo      Canada … Branta… L465… "Bingh… 2024…       8  42.1 -75.9 TRUE    
#>  5 cangoo      Canada … Branta… L300… "Our L… 2024…       2  42.1 -75.9 TRUE    
#>  6 cangoo      Canada … Branta… L145… "Lake … 2024…       2  41.8 -75.8 TRUE    
#>  7 cangoo      Canada … Branta… L204… "McDon… 2024…       4  41.8 -75.9 TRUE    
#>  8 cangoo      Canada … Branta… L936… "Bolan… 2024…       6  42.2 -75.9 TRUE    
#>  9 cangoo      Canada … Branta… L186… "Otsin… 2024…      10  42.1 -75.9 TRUE    
#> 10 cangoo      Canada … Branta… L717… "PA-SQ… 2024…       2  41.9 -75.9 TRUE    
#> # ℹ 57 more rows
#> # ℹ 3 more variables: obsReviewed <lgl>, locationPrivate <lgl>, subId <chr>

Recent notable sightings

Search for notable sightings at a given latitude and longitude

ebirdnotable(lat = 42, lng = -70)
#> # A tibble: 3,200 × 14
#>    speciesCode comName  sciName locId locName obsDt howMany   lat   lng obsValid
#>    <chr>       <chr>    <chr>   <chr> <chr>   <chr>   <int> <dbl> <dbl> <lgl>   
#>  1 osprey      Osprey   Pandio… L300… 100 Gr… 2024…       1  41.7 -72.6 FALSE   
#>  2 fiespa      Field S… Spizel… L514… Pinnac… 2024…       1  43.1 -72.4 FALSE   
#>  3 chispa      Chippin… Spizel… L586… High S… 2024…       2  42.9 -70.8 FALSE   
#>  4 palwar3     Palm Wa… Setoph… L250… Hampto… 2024…       1  42.9 -70.8 FALSE   
#>  5 bkhgul      Black-h… Chroic… L829… Dowses… 2024…       5  41.6 -70.4 FALSE   
#>  6 rosgoo      Ross's … Anser … L279… Hardar… 2024…       1  42.9 -70.8 FALSE   
#>  7 osprey      Osprey   Pandio… L675… Longme… 2024…       2  42.1 -72.6 FALSE   
#>  8 yebsap      Yellow-… Sphyra… L458… Waldob… 2024…       1  44.1 -69.4 FALSE   
#>  9 yebsap      Yellow-… Sphyra… L458… Waldob… 2024…       1  44.1 -69.4 FALSE   
#> 10 baleag      Bald Ea… Haliae… L226… W Basi… 2024…       1  41.4 -70.8 FALSE   
#> # ℹ 3,190 more rows
#> # ℹ 4 more variables: obsReviewed <lgl>, locationPrivate <lgl>, subId <chr>,
#> #   exoticCategory <chr>

or a region

ebirdnotable(locID = 'US-NY-109')
#> # A tibble: 84 × 13
#>    speciesCode comName  sciName locId locName obsDt howMany   lat   lng obsValid
#>    <chr>       <chr>    <chr>   <chr> <chr>   <chr>   <int> <dbl> <dbl> <lgl>   
#>  1 veggul1     Herring… Larus … L212… Steven… 2024…       1  42.4 -76.4 FALSE   
#>  2 sancra      Sandhil… Antigo… L212… Steven… 2024…       9  42.4 -76.4 FALSE   
#>  3 sancra      Sandhil… Antigo… L212… Steven… 2024…       9  42.4 -76.4 FALSE   
#>  4 veggul1     Herring… Larus … L212… Steven… 2024…       1  42.4 -76.4 FALSE   
#>  5 veggul1     Herring… Larus … L212… Steven… 2024…       1  42.4 -76.4 FALSE   
#>  6 veggul1     Herring… Larus … L212… Steven… 2024…       1  42.4 -76.4 FALSE   
#>  7 eastow1     Eastern… Pipilo… L117… Ringwo… 2024…       1  42.4 -76.4 FALSE   
#>  8 eastow1     Eastern… Pipilo… L117… Ringwo… 2024…       1  42.4 -76.4 FALSE   
#>  9 eastow1     Eastern… Pipilo… L117… Ringwo… 2024…       1  42.4 -76.4 FALSE   
#> 10 eastow1     Eastern… Pipilo… L117… Ringwo… 2024…       1  42.4 -76.4 FALSE   
#> # ℹ 74 more rows
#> # ℹ 3 more variables: obsReviewed <lgl>, locationPrivate <lgl>, subId <chr>

Historic Observations

Obtain a list of species reported on a specific date in a given region

ebirdhistorical(loc = 'US-VA-003', date = '2019-02-14',max = 10)
#> # A tibble: 10 × 13
#>    speciesCode comName  sciName locId locName obsDt howMany   lat   lng obsValid
#>    <chr>       <chr>    <chr>   <chr> <chr>   <chr>   <int> <dbl> <dbl> <lgl>   
#>  1 cangoo      Canada … Branta… L139… Lickin… 2019…      30  38.1 -78.7 TRUE    
#>  2 mallar3     Mallard  Anas p… L139… Lickin… 2019…       5  38.1 -78.7 TRUE    
#>  3 gnwtea      Green-w… Anas c… L139… Lickin… 2019…       8  38.1 -78.7 TRUE    
#>  4 killde      Killdeer Charad… L139… Lickin… 2019…       1  38.1 -78.7 TRUE    
#>  5 baleag      Bald Ea… Haliae… L139… Lickin… 2019…       1  38.1 -78.7 TRUE    
#>  6 belkin1     Belted … Megace… L139… Lickin… 2019…       1  38.1 -78.7 TRUE    
#>  7 carwre      Carolin… Thryot… L139… Lickin… 2019…       1  38.1 -78.7 TRUE    
#>  8 whtspa      White-t… Zonotr… L139… Lickin… 2019…       2  38.1 -78.7 TRUE    
#>  9 norcar      Norther… Cardin… L139… Lickin… 2019…       1  38.1 -78.7 TRUE    
#> 10 canvas      Canvasb… Aythya… L331… Montic… 2019…      19  38.0 -78.5 TRUE    
#> # ℹ 3 more variables: obsReviewed <lgl>, locationPrivate <lgl>, subId <chr>

or a hotspot

ebirdhistorical(loc = 'L196159', date = '2019-02-14', fieldSet = 'full')
#> # A tibble: 14 × 27
#>    speciesCode comName  sciName locId locName obsDt howMany   lat   lng obsValid
#>    <chr>       <chr>    <chr>   <chr> <chr>   <chr>   <int> <dbl> <dbl> <lgl>   
#>  1 annhum      Anna's … Calypt… L196… Vancou… 2019…       4  49.3 -123. TRUE    
#>  2 ribgul      Ring-bi… Larus … L196… Vancou… 2019…       4  49.3 -123. TRUE    
#>  3 glwgul      Glaucou… Larus … L196… Vancou… 2019…      29  49.3 -123. TRUE    
#>  4 amecro      America… Corvus… L196… Vancou… 2019…     100  49.3 -123. TRUE    
#>  5 bkcchi      Black-c… Poecil… L196… Vancou… 2019…      16  49.3 -123. TRUE    
#>  6 bushti      Bushtit  Psaltr… L196… Vancou… 2019…      20  49.3 -123. TRUE    
#>  7 pacwre1     Pacific… Troglo… L196… Vancou… 2019…       1  49.3 -123. TRUE    
#>  8 houfin      House F… Haemor… L196… Vancou… 2019…       2  49.3 -123. TRUE    
#>  9 purfin      Purple … Haemor… L196… Vancou… 2019…       3  49.3 -123. TRUE    
#> 10 amegfi      America… Spinus… L196… Vancou… 2019…      15  49.3 -123. TRUE    
#> 11 daejun      Dark-ey… Junco … L196… Vancou… 2019…      37  49.3 -123. TRUE    
#> 12 sonspa      Song Sp… Melosp… L196… Vancou… 2019…      12  49.3 -123. TRUE    
#> 13 spotow      Spotted… Pipilo… L196… Vancou… 2019…       1  49.3 -123. TRUE    
#> 14 rewbla      Red-win… Agelai… L196… Vancou… 2019…       6  49.3 -123. TRUE    
#> # ℹ 17 more variables: obsReviewed <lgl>, locationPrivate <lgl>, subId <chr>,
#> #   subnational2Code <chr>, subnational2Name <chr>, subnational1Code <chr>,
#> #   subnational1Name <chr>, countryCode <chr>, countryName <chr>,
#> #   userDisplayName <chr>, obsId <chr>, checklistId <chr>, presenceNoted <lgl>,
#> #   hasComments <lgl>, firstName <chr>, lastName <chr>, hasRichMedia <lgl>

Information on a given region or hotspot

Obtain detailed information on any valid eBird region

ebirdregioninfo("CA-BC-GV")
#> # A tibble: 1 × 5
#>   region                                     minX  maxX  minY  maxY
#>   <chr>                                     <dbl> <dbl> <dbl> <dbl>
#> 1 Metro Vancouver, British Columbia, Canada -123. -122.  49.0  49.6

or hotspot

ebirdregioninfo("L196159")
#> # A tibble: 1 × 16
#>   locId   name       latitude longitude countryCode countryName subnational1Name
#>   <chr>   <chr>         <dbl>     <dbl> <chr>       <chr>       <chr>           
#> 1 L196159 Vancouver…     49.3     -123. CA          Canada      British Columbia
#> # ℹ 9 more variables: subnational1Code <chr>, subnational2Code <chr>,
#> #   subnational2Name <chr>, isHotspot <lgl>, locName <chr>, lat <dbl>,
#> #   lng <dbl>, hierarchicalName <chr>, locID <chr>

Obtain a list of eBird species codes for all species recorded in a region

ebirdregionspecies("GB-ENG-LND")
#> # A tibble: 383 × 1
#>    speciesCode
#>    <chr>      
#>  1 wfwduc1    
#>  2 fuwduc     
#>  3 bahgoo     
#>  4 empgoo     
#>  5 snogoo     
#>  6 rosgoo     
#>  7 gragoo     
#>  8 swagoo1    
#>  9 gwfgoo     
#> 10 lwfgoo     
#> # ℹ 373 more rows

or a hotspot

ebirdregionspecies("L5803024")
#> # A tibble: 181 × 1
#>    speciesCode
#>    <chr>      
#>  1 gragoo     
#>  2 gwfgoo     
#>  3 pifgoo     
#>  4 bargoo     
#>  5 cangoo     
#>  6 x00758     
#>  7 mutswa     
#>  8 whoswa     
#>  9 egygoo     
#> 10 comshe     
#> # ℹ 171 more rows

Obtain a list of all subregions within an eBird region

ebirdsubregionlist("subnational1","US")
#> # A tibble: 51 × 2
#>    code  name                
#>    <chr> <chr>               
#>  1 US-AL Alabama             
#>  2 US-AK Alaska              
#>  3 US-AZ Arizona             
#>  4 US-AR Arkansas            
#>  5 US-CA California          
#>  6 US-CO Colorado            
#>  7 US-CT Connecticut         
#>  8 US-DE Delaware            
#>  9 US-DC District of Columbia
#> 10 US-FL Florida             
#> # ℹ 41 more rows

Checklist Feed

Obtain a list of checklists submitted on a given date at a region or hotspot

ebirdchecklistfeed(loc = "L207391", date = "2020-03-24", max = 5)
#> # A tibble: 5 × 9
#>   locId   subId  userDisplayName numSpecies obsDt obsTime isoObsDate subID loc  
#>   <chr>   <chr>  <chr>                <int> <chr> <chr>   <chr>      <chr> <chr>
#> 1 L207391 S6617… David Wood              10 24 M… 14:47   2020-03-2… S661… L207…
#> 2 L207391 S6617… Sofia Prado-Ir…         15 24 M… 14:31   2020-03-2… S661… L207…
#> 3 L207391 S6619… Jeffrey Gantz           19 24 M… 13:30   2020-03-2… S661… L207…
#> 4 L207391 S6617… Ann Gurka               21 24 M… 13:00   2020-03-2… S661… L207…
#> 5 L207391 S7098… Barbara Olson           20 24 M… 10:30   2020-03-2… S709… L207…

View Checklist

Obtain all information on a specific checklist

ebirdchecklist("S139153079")
#> # A tibble: 99 × 24
#>    subId      protocolId locId groupId   durationHrs allObsReported subComments 
#>    <chr>      <chr>      <chr> <chr>           <dbl> <lgl>          <chr>       
#>  1 S139153079 P22        L17   G10310841        11.2 TRUE           "There are …
#>  2 S139153079 P22        L17   G10310841        11.2 TRUE           "There are …
#>  3 S139153079 P22        L17   G10310841        11.2 TRUE           "There are …
#>  4 S139153079 P22        L17   G10310841        11.2 TRUE           "There are …
#>  5 S139153079 P22        L17   G10310841        11.2 TRUE           "There are …
#>  6 S139153079 P22        L17   G10310841        11.2 TRUE           "There are …
#>  7 S139153079 P22        L17   G10310841        11.2 TRUE           "There are …
#>  8 S139153079 P22        L17   G10310841        11.2 TRUE           "There are …
#>  9 S139153079 P22        L17   G10310841        11.2 TRUE           "There are …
#> 10 S139153079 P22        L17   G10310841        11.2 TRUE           "There are …
#> # ℹ 89 more rows
#> # ℹ 17 more variables: creationDt <chr>, lastEditedDt <chr>, obsDt <chr>,
#> #   obsTimeValid <lgl>, checklistId <chr>, numObservers <int>,
#> #   effortDistanceKm <dbl>, effortDistanceEnteredUnit <chr>,
#> #   subnational1Code <chr>, userDisplayName <chr>, numSpecies <int>,
#> #   speciesCode <chr>, obsId <chr>, howManyStr <chr>, obsComments <chr>,
#> #   photoCounts <int>, videoCounts <int>

Hotspots in a region or nearby coordinates

Obtain a list of hotspots within a region

ebirdhotspotlist("CA-NS-HL")
#> # A tibble: 290 × 9
#>    locId     locName   countryCode subnational1Code subnational2Code   lat   lng
#>    <chr>     <chr>     <chr>       <chr>            <chr>            <dbl> <dbl>
#>  1 L2334369  Abraham … CA          CA-NS            CA-NS-HL          45.2 -62.6
#>  2 L7003818  Admiral … CA          CA-NS            CA-NS-HL          44.7 -63.7
#>  3 L1765807  Admiral … CA          CA-NS            CA-NS-HL          44.8 -63.1
#>  4 L12227034 Armdale-… CA          CA-NS            CA-NS-HL          44.6 -63.6
#>  5 L12690538 Armdale-… CA          CA-NS            CA-NS-HL          44.6 -63.6
#>  6 L2390509  Bald Roc… CA          CA-NS            CA-NS-HL          44.5 -63.6
#>  7 L7598385  Bayers L… CA          CA-NS            CA-NS-HL          44.6 -63.7
#>  8 L11019120 Beaver B… CA          CA-NS            CA-NS-HL          44.8 -63.7
#>  9 L1872934  Bedford … CA          CA-NS            CA-NS-HL          44.7 -63.7
#> 10 L12134597 Bedford-… CA          CA-NS            CA-NS-HL          44.7 -63.7
#> # ℹ 280 more rows
#> # ℹ 2 more variables: latestObsDt <chr>, numSpeciesAllTime <int>

or within a radius of up to 50 kilometers, from a given set of coordinates.

ebirdhotspotlist(lat = 30, lng = -90, dist = 10)
#> No region code provided, locating hotspots using lat/lng
#> # A tibble: 54 × 9
#>    locId    locName    countryCode subnational1Code subnational2Code   lat   lng
#>    <chr>    <chr>      <chr>       <chr>            <chr>            <dbl> <dbl>
#>  1 L6025517 Algiers P… US          US-LA            US-LA-071         30.0 -90.1
#>  2 L3886471 Armstrong… US          US-LA            US-LA-071         30.0 -90.1
#>  3 L727179  Audubon L… US          US-LA            US-LA-071         30.0 -90.0
#>  4 L6665071 BAEA Nest… US          US-LA            US-LA-087         30.0 -90.0
#>  5 L6666949 BAEA Nest… US          US-LA            US-LA-071         29.9 -90.0
#>  6 L2423926 Bayou Bie… US          US-LA            US-LA-071         30.0 -90.0
#>  7 L725034  Bayou Sau… US          US-LA            US-LA-071         30.1 -89.9
#>  8 L727232  Chalmette… US          US-LA            US-LA-087         29.9 -90.0
#>  9 L453412  City Park… US          US-LA            US-LA-071         30.0 -90.1
#> 10 L5229399 City Park… US          US-LA            US-LA-071         30.0 -90.1
#> # ℹ 44 more rows
#> # ℹ 2 more variables: latestObsDt <chr>, numSpeciesAllTime <int>

rebird and other packages

How to use rebird

This package is part of a richer suite called spocc - Species Occurrence Data, along with several other packages, that provide access to occurrence records from multiple databases. We recommend using spocc as the primary R interface to rebird unless your needs are limited to this single source.

auk vs. rebird

Those interested in eBird data may also want to consider auk, an R package that helps extracting and processing the whole eBird dataset. The functions in rebird are faster but mostly limited to accessing recent (i.e. within the last 30 days) observations, although ebirdfreq() does provide historical frequency of observation data. In contrast, auk gives access to the full set of ~ 500 million eBird observations. For most ecological applications, users will require auk; however, for some use cases, e.g. building tools for birders, rebird provides a quicker and easier way to access data. rebird and auk are both part of the rOpenSci project.

API requests covered by rebird

The 2.0 APIs have considerably been expanded from the previous version, and rebird only covers some of them. The webservices covered are listed below; if you’d like to contribute wrappers to APIs not yet covered by this package, feel free to submit a pull request!

data/obs

  • Recent observations in a region: ebirdregion()
  • Recent notable observations in a region: ebirdnotable()
  • Recent observations of a species in a region: ebirdregion()
  • Recent nearby observations: ebirdgeo()
  • Recent nearby observations of a species: ebirdgeo()
  • Nearest observations of a species: nearestobs()
  • Recent nearby notable observations: ebirdnotable()
  • Recent checklists feed
  • Historic observations on a date: ebirdhistorical()

product

  • Top 100
  • Checklist feed on a date: ebirdchecklistfeed()
  • Regional statistics on a date
  • Species list for a region: ebirdregionspecies()
  • View Checklist: ebirdchecklist()

ref/geo

  • Adjacent Regions

ref/hotspot

  • Hotspots in a region: ebirdhotspotlist()
  • Nearby hotspots: ebirdhotspotlist()
  • Hotspot Info: ebirdregioninfo()

ref/taxonomy

  • eBird Taxonomy: ebirdtaxonomy()
  • Taxonomic Forms
  • Taxonomy Versions
  • Taxonomic Groups

ref/region

  • Region Info: ebirdregioninfo()
  • Sub Region List ebirdsubregionlist()

Meta

  • Please report any issues or bugs.
  • License: MIT
  • Get citation information for rebird in R doing citation(package = 'rebird')
  • Please note that the ‘rebird’ project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

ropensci_footer

rebird's People

Contributors

ateucher avatar dbradnum avatar gbabineau avatar graceli8 avatar karthik avatar mfoos avatar mpadge avatar rafnuss avatar richardlitt avatar rmaia avatar sckott avatar sebpardo avatar slager avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rebird's Issues

A way to get older observations?

Currently, the documentation for ebirdloc says that it can only go back 30 days. It would be useful to be able to go back farther (e.g. to take a 30-day chunk from last summer).

Thanks for making such a cool package!

Travis-ci and Coveralls not updating

I noticed that travis-ci and coveralls are not being ran with the latest commits/releases; travis-ci last ran on an commit from 8 months ago while coveralls last ran 5 years ago. Obviously this isn't any issue with rebird itself, but I wonder if we should update the badges? @sckott ?

Add vignette

@rmaia I'm adding this posthumously (spelling?) - in that I already added the vignette in a recent push today

I just basically took examples from each functions examples section. Hope that's okay. I played around a bit with the knitr docco style. Check it out when you install, then load the package. Do change if you want.

Also updated readme with a few examples. Hope that's okay.

Get species for location / region

I recently helped a fellow eBirder answer a question about the total number of species seen at hotspots within a distance of his home. This involved a couple of eBird API functions that aren't yet included in rebird:

  1. Get nearby hotspots
  2. Get species list for a region

I've got R code up and running for both of these now, and am happy to tidy it up and submit as pull requests for the package - hopefully it'll be useful for other people.
I can see that #83 is already open for the first API call, so I'm raising this to cover the second one.

Hope this all sounds OK? Do let know if there's anything I should bear in mind, or I inadvertantly go astray with the fork > branch > pull request process!

Wrapper to part of the eBird API

Would it be possible to clarify which webservice(s) from the eBird API are wrapped in this package? I think it'd be an useful addition to the docs.

Once the package has been switched to the new API, asking for contributors to add new endpoints wrappers might be a good way to have first-time contributors?

ebirdfreq failure - URL directs to login page(?)

Hi,

I'm consistently getting a failure from the ebirdfreq() function. When I try the examples in the package documentation, I get an error as follows:

> ebirdfreq(loctype = 'hotspots', loc = 'L196159')
Error in `.rowNamesDF<-`(x, value = value) : 
  duplicate 'row.names' are not allowed
In addition: Warning message:
non-unique values when setting 'row.names': ‘    .January-1’, ‘.January-1’, ‘</a>.January-1’, ‘</div>.January-1’, ‘</g>.January-1’, ‘</label>.January-1’, ‘</svg>.January-1’, ‘<g class=LogoLab-ofOrnithology fill=#000 transform=translate(335.03 17.285)>.January-1’, ‘<g class=LogoLab-sapsucker transform=translate(242.966)>.January-1’, ‘<g class=LogoLab-theCornellLab fill=#000 transform=translate(0 17.285)>.January-1’, ‘<path d=M0.138375929,2.72872008 C0.138375929,3.83301149 1.01946082,4.71324377 2.12749183,4.71324377 C3.23285288,4.71324377 4.11393777,3.83301149 4.11660773,2.72872008 C4.11393777,1.6217613 3.23018292,0.741529015 2.12749183,0.738861644 C1.02213078,0.741529015 0.138375929,1.6217613 0.138375929,2.72872008 L0.138375929,2.72872008 Z/>.January-1’, ‘<path d=M134.835358 31.9764382C132.958381 31.9737709 131.81297 30.8268015 131.8103 28.9116295L131.8103 15.0039594 137.881776 15.0039594 137.881776 12.683347 131.8103 12.683347 131.8103 6.57240105 129.212435 6.57240105 129.212435 12.683 [... truncated] 

It seems that the call to the URL is returning an HTML document rather than a TSV as expected. I can see that when I try to construct the URL myself - eg https://ebird.org/ebird/barchartData?byr=1900&eyr=2020&bmo=1&emo=12&r=L196159&fmt=tsv - and plug it into Chrome, I get the file I expect.... but I have to be logged in first.

Having now dug into the package source a bit, and stepped through the code up to here, it looks like the web response we're getting in R is the eBird log-in page, rather than the lovely TSV data file we want :-(

I guess maybe something has changed on eBird's end? Worth noting that I do have an ebird access token, and other functions (eg nearestobs(), ebirdregion()) are working fine. But I think this one isn't connected up to the same API, so it's a different case.

Any suggestions for getting this working again would be much appreciated - and do let me know if you need any more info or I can help otherwise.

Session Info > devtools::session_info() - Session info ------------------------------------------------------------------------------------------------------ setting value version R version 4.0.3 (2020-10-10) os Windows 10 x64 system x86_64, mingw32 ui RStudio language (EN) collate English_United Kingdom.1252 ctype English_United Kingdom.1252 tz Europe/London date 2020-10-22
  • Packages ----------------------------------------------------------------------------------------------------------
    package * version date lib source
    assertthat 0.2.1 2019-03-21 [1] CRAN (R 4.0.3)
    backports 1.1.10 2020-09-15 [1] CRAN (R 4.0.3)
    callr 3.5.1 2020-10-13 [1] CRAN (R 4.0.3)
    cli 2.1.0 2020-10-12 [1] CRAN (R 4.0.3)
    crayon 1.3.4 2017-09-16 [1] CRAN (R 4.0.3)
    curl 4.3 2019-12-02 [1] CRAN (R 4.0.3)
    desc 1.2.0 2018-05-01 [1] CRAN (R 4.0.3)
    devtools 2.3.2 2020-09-18 [1] CRAN (R 4.0.3)
    digest 0.6.25 2020-02-23 [1] CRAN (R 4.0.3)
    dplyr 1.0.2 2020-08-18 [1] CRAN (R 4.0.3)
    ellipsis 0.3.1 2020-05-15 [1] CRAN (R 4.0.3)
    evaluate 0.14 2019-05-28 [1] CRAN (R 4.0.3)
    fansi 0.4.1 2020-01-08 [1] CRAN (R 4.0.3)
    fs 1.5.0 2020-07-31 [1] CRAN (R 4.0.3)
    generics 0.0.2 2018-11-29 [1] CRAN (R 4.0.3)
    glue 1.4.2 2020-08-27 [1] CRAN (R 4.0.3)
    htmltools 0.5.0 2020-06-16 [1] CRAN (R 4.0.3)
    httr 1.4.2 2020-07-20 [1] CRAN (R 4.0.3)
    jsonlite 1.7.1 2020-09-07 [1] CRAN (R 4.0.3)
    knitr 1.30 2020-09-22 [1] CRAN (R 4.0.3)
    lifecycle 0.2.0 2020-03-06 [1] CRAN (R 4.0.3)
    magrittr 1.5 2014-11-22 [1] CRAN (R 4.0.3)
    memoise 1.1.0 2017-04-21 [1] CRAN (R 4.0.3)
    pillar 1.4.6 2020-07-10 [1] CRAN (R 4.0.3)
    pkgbuild 1.1.0 2020-07-13 [1] CRAN (R 4.0.3)
    pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 4.0.3)
    pkgload 1.1.0 2020-05-29 [1] CRAN (R 4.0.3)
    prettyunits 1.1.1 2020-01-24 [1] CRAN (R 4.0.3)
    processx 3.4.4 2020-09-03 [1] CRAN (R 4.0.3)
    ps 1.4.0 2020-10-07 [1] CRAN (R 4.0.3)
    purrr 0.3.4 2020-04-17 [1] CRAN (R 4.0.3)
    R6 2.4.1 2019-11-12 [1] CRAN (R 4.0.3)
    rebird * 1.1.0 2019-10-24 [1] CRAN (R 4.0.3)
    remotes 2.2.0 2020-07-21 [1] CRAN (R 4.0.3)
    rlang 0.4.8 2020-10-08 [1] CRAN (R 4.0.3)
    rmarkdown 2.4 2020-09-30 [1] CRAN (R 4.0.3)
    rprojroot 1.3-2 2018-01-03 [1] CRAN (R 4.0.3)
    rstudioapi 0.11 2020-02-07 [1] CRAN (R 4.0.3)
    sessioninfo 1.1.1 2018-11-05 [1] CRAN (R 4.0.3)
    testthat 2.3.2 2020-03-02 [1] CRAN (R 4.0.3)
    tibble 3.0.4 2020-10-12 [1] CRAN (R 4.0.3)
    tidyselect 1.1.0 2020-05-11 [1] CRAN (R 4.0.3)
    usethis 1.6.3 2020-09-17 [1] CRAN (R 4.0.3)
    vctrs 0.3.4 2020-08-29 [1] CRAN (R 4.0.3)
    withr 2.3.0 2020-09-22 [1] CRAN (R 4.0.3)
    xfun 0.18 2020-09-29 [1] CRAN (R 4.0.3)
    yaml 2.2.1 2020-02-01 [1] CRAN (R 4.0.3)

[1] C:/Users/dbrad/Documents/R/win-library/4.0
[2] C:/Program Files/R/R-4.0.3/library

As of 2017-04-06, ebirdfreq returns a 404 error

For example, this piece of code from the examples is not working anymore :
ebirdfreq(loctype = 'hotspots', loc = 'L196159')

From looking at the code, it seems the url is constructed with a capitalized version of the url :
url <- "http://ebird.org/ebird/BarChart" which, as of today does not seem to be supported.

For example, compare these :
http://ebird.org/ebird/barchart?byr=1900&eyr=2017&bmo=1&emo=12&r=US-AL
http://ebird.org/ebird/BarChart?byr=1900&eyr=2017&bmo=1&emo=12&r=US-AL

This happens with version 0.3.0, latest version on CRAN

ebirdregion should return all observations, but fails to return a few, although these may be retrievable by ebirdnotable

Hello

I love this package. I am wondering how the search is performed though, as there seems to be some inconsistencies..

Consider for instance this checklist from yesterday, Oct 17th: https://ebird.org/view/checklist/S49257480
It contains 72 species. By calling ebirdregion(loc = 'DK') and followingly filtering out that particular location and date, I only get 62 out of 72 observations. 10 are missing, including the notable observation "Dusky Warbler 3".

If I, however use ebirdnotable(loc='DK'), I get two observations that INCLUDES the "Dusky Warbler 3" observation. I suspect there is some delay for recently submitted observations before they are accessible for extraction and this is likely on eBird API's end. In any case though, I would like to hear some feedback from you, whether this is a known issue.

I originally discovered the error simply because ebirdnotable() was able to find this dusky warbler record, while the call ebirdregion(loc = 'DK', species = 'duswar') couldn't. Both functions could however properly extract another Dusky Warbler observation from October 16th, so I will not be surprised if by tomorrow, the ebirdregion() call will be able to retrieve all 72 observations from the checklist in consideration.

So: any explanation for the possible delay and inevitable inconsitency between ebirdnotable and ebirdregion?

Mathias

Push v0.2 to CRAN soon?

Seems like we've had many changes in this package lately. Should we push a new version v0.2 to CRAN soon?

I made a milestone for this v0.2 we can assign issues to.

Rownames error using ebirdfreq

Simply running the example in the doc throws in a rownames error. Maybe related to recent updates in the tidyverse suite of packages?

freqs <- ebirdfreq(loctype = "hotspots", loc = 'L196159')

Error in `.rowNamesDF<-`(x, value = value) : 
  duplicate 'row.names' are not allowed
In addition: Warning message:
non-unique values when setting 'row.names':.January-1’, ‘.January-1’, ‘</a>.January-1’, ‘</div>.January-1’, ‘</g>.January-1’, ‘</label>.January-1’, ‘</svg>.January-1’, ‘<g class=LogoLab-ofOrnithology fill=#000 transform=translate(335.03 17.285)>.January-1’, ‘<g class=LogoLab-sapsucker transform=translate(242.966)>.January-1’, ‘<g class=LogoLab-theCornellLab fill=#000 transform=translate(0 17.285)>.January-1’, ‘<path d=M0.138375929,2.72872008 C0.138375929,3.83301149 1.01946082,4.71324377 2.12749183,4.71324377 C3.23285288,4.71324377 4.11393777,3.83301149 4.11660773,2.72872008 C4.11393777,1.6217613 3.23018292,0.741529015 2.12749183,0.738861644 C1.02213078,0.741529015 0.138375929,1.6217613 0.138375929,2.72872008 L0.138375929,2.72872008 Z/>.January-1’, ‘<path d=M134.835358 31.9764382C132.958381 31.9737709 131.81297 30.8268015 131.8103 28.9116295L131.8103 15.0039594 137.881776 15.0039594 137.881776 12.683347 131.8103 12.683347 131.8103 6.57 [... truncated] 
Session Info
R version 4.0.3 (2020-10-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Pop!_OS 20.04 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0

locale:
 [1] LC_CTYPE=en_CA.UTF-8       LC_NUMERIC=C               LC_TIME=en_CA.UTF-8        LC_COLLATE=en_CA.UTF-8    
 [5] LC_MONETARY=en_CA.UTF-8    LC_MESSAGES=en_CA.UTF-8    LC_PAPER=en_CA.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_CA.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] forcats_0.5.0   stringr_1.4.0   dplyr_1.0.2     purrr_0.3.4     readr_1.4.0     tidyr_1.1.2     tibble_3.0.4   
 [8] ggplot2_3.3.2   tidyverse_1.3.0 raster_3.4-5    sp_1.4-4        rebird_1.1.2    sf_0.9-6       

loaded via a namespace (and not attached):
 [1] tidyselect_1.1.0   haven_2.3.1        lattice_0.20-41    colorspace_1.4-1   vctrs_0.3.5        generics_0.1.0    
 [7] blob_1.2.1         rlang_0.4.9        e1071_1.7-4        pillar_1.4.7       withr_2.3.0        glue_1.4.2        
[13] DBI_1.1.0          dbplyr_1.4.4       modelr_0.1.8       readxl_1.3.1       lifecycle_0.2.0    munsell_0.5.0     
[19] gtable_0.3.0       cellranger_1.1.0   rvest_0.3.6        codetools_0.2-16   curl_4.3           class_7.3-17      
[25] fansi_0.4.1        broom_0.7.1        Rcpp_1.0.5         KernSmooth_2.23-17 backports_1.1.9    scales_1.1.1      
[31] classInt_0.4-3     jsonlite_1.7.1     fs_1.5.0           hms_0.5.3          stringi_1.5.3      grid_4.0.3        
[37] cli_2.2.0          tools_4.0.3        magrittr_2.0.1     crayon_1.3.4       pkgconfig_2.0.3    ellipsis_0.3.1    
[43] xml2_1.3.2         reprex_0.3.0       lubridate_1.7.9    assertthat_0.2.1   httr_1.4.2         rstudioapi_0.11   
[49] R6_2.5.0           units_0.6-7        compiler_4.0.3  

Is it possible to map the locations of the bird observations?

Hi,

Is it possible to map (google maps, OpenStreetMap) multiple locations of the bird observations via R rebird or other R package?
For instance the locations (Long. and lat.) of a specific bird in the USA found with ebirdregion function:

Example:
ebirdregion(region = 'US', species = 'Passer domesticus')

Best,
Cordny
the Netherlands

Curl options

Most or all fxns have a ... parameter to pass on curl options, but internally there is no way to catch and pass on these options.

Regional statistics on a date

Hi all, thank you for this package—it’s been useful for many projects I’ve been involved with!

I’m wondering about the status of a function for the “Regional statistics on a date” endpoint. Is there a specific reason it’s not been added or is it simply that nobody has given it a try yet? Thought I’d ask before trying myself!

Location precedence in ebirdnotable

Sort out what to do when > 1 location type provided. I suggest most specific takes precedence (lat/lng > hotspot > region). I've started on this.

export taxonomy?

It could be useful for the package to export the internal taxonomy data object so that other packages can reference that object without getting R CMD CHECK warnings. Happy to do a PR for this if you're amenable to it.

error behavior

noticed when fixing spocc's ebird integration that error behavior could be better.

when the API key is not found or not set, there's a nice error message about this. 👍

But if the API key is bad/not known by eBird, the error behavior is pretty bad:

library(rebird)

# works fine
ebirdregion(loc = 'US', species = 'btbwar') 

# unset api key
Sys.unsetenv('EBIRD_KEY')

# fails nicely
ebirdregion(loc = 'US', species = 'btbwar')
#> Error: 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.

# change API key to an obvisouly bad value
Sys.setenv(EBIRD_KEY = 'a')

# now fails badly
ebirdregion(loc = 'US', species = 'btbwar')
#> Error: parse error: premature EOF
#> 
#>                      (right here) ------^

The problem is the data from eBird is being processed before checking for any errors - here https://github.com/ropensci/rebird/blob/master/R/zzz.R#L37-L38 There i a proper error on the above request (403 http status code), so you should be able to catch that and then proceed accordingly with a nice error for the user.

ebirdhistorical error for loc = "AR"

Hello,

I am trying to download data for Argentina using the ebirdhistorical function:

ebirdhistorical(loc="AR",date="2020-05-09",key = EBIRD_KEY)

This gives the error:
Error in ebird_GET(url, args, key = key, ...) : 500 -- http.status.500 -- PreparedStatementCallback; SQL ORA-01013: user requested cancel of current operation; nested exception is java.sql.SQLTimeoutException: ORA-01013: user requested cancel of current operation

I have also tried:
ebirdhistorical(loc="AR",date="2020-05-09",key = BIRD_KEY, config= httr::timeout(60*10)), max=10000)
I get the same error.

The function works for other regions (including US, CO & KE) just fine, but not AR. What could the issue be?
Date of my download attempt = "2020-05-31"

Many thanks,

Pete S

ebird_GET() : Unknown species: Genus%20species = double url encoding ?

I couldn't use ebird_GET() without a warning like :
In ebird_GET(url, args, ...) : Unknown species: Anas%20platyrhynchos

It seems that the space charater ' ' is encoded two times : ' ' ->'%20' ->'%2520'

GET function use an url with 'Anas%2520platyrhynchos' instead of 'Anas%20platyrhynchos'.
See the following example with the verbose enabled :
``

ebirdgeo('Anas platyrhynchos', 39, -121, max=5, config=verbose())
-> GET /ws1.1/data/obs/geo_spp/recent?fmt=json&sci=Anas%20platyrhynchos&lat=39&lng=-121&maxResults=5 HTTP/1.1
-> Host: ebird.org
-> User-Agent: libcurl/7.59.0 r-curl/3.2 httr/1.3.1
-> Accept-Encoding: gzip, deflate
-> Accept: application/json, text/xml, application/xml, /
->
<- HTTP/1.1 302 Found
<- Date: Tue, 05 Jun 2018 13:39:33 GMT
<- Server: Apache
<- Location: https://ebird.org/ws1.1/data/obs/geo_spp/recent?fmt=json&sci=Anas%2520platyrhynchos&lat=39&lng=-121&maxResults=5
<- Content-Length: 312
<- Content-Type: text/html; charset=iso-8859-1
<- X-OSSProxy: OSSProxy 1.3.337.412 (Build 337.412 Win32 en-us)(Jan 11 2018 14:07:40)
<- Connection: keep-alive
<-
-> GET /ws1.1/data/obs/geo_spp/recent?fmt=json&sci=Anas%2520platyrhynchos&lat=39&lng=-121&maxResults=5 HTTP/1.1
-> Host: ebird.org
-> User-Agent: libcurl/7.59.0 r-curl/3.2 httr/1.3.1
-> Accept-Encoding: gzip, deflate
-> Accept: application/json, text/xml, application/xml, /
->
<- HTTP/1.1 400 400
<- Date: Tue, 05 Jun 2018 13:39:33 GMT
<- Server: Apache
<- Content-Encoding: gzip
<- Content-Type: application/json;charset=utf-8
<- Content-Length: 96
<- Connection: close
<-
[1] NA
Warning message:
In ebird_GET(url, args, ...) : Unknown species: Anas%20platyrhynchos
``

I tried it using the v0.4.0 in rstudio (windows) and with linux Rscripts, same issue when using the spocc package.
Do you know if it's a wrong use of the function or a bug with the request ?
Thank for your help

Would like to contribute a checklist feed function

Hi folks,

I wrote a function (and tests) to access the checklist feed API endpoint https://documenter.getpostman.com/view/664302/S1ENwy59?version=latest#4416a7cc-623b-4340-ab01-80c599ede73e

and then realized that the contributor guidelines say to post before making a PR. Also, I am working with a different version of roxygen, so I'm reluctant to include the man/(filename).Rd file in the commit because the formats are slightly different.

Any thoughts before I make a PR?

thanks!
M

Bug from CRAN core

Package: rebird Version: 0.1
Check: DESCRIPTION meta-information ... NOTE
Deprecated license: BSD

Version, two or three digits to CRAN?

Currently rebird releases only two digits to CRAN, and uses the third one for the development versions. I've seen that most other packages (and what Hadley recommends in his book) is to release three digits to CRAN and use the fourth one for devel.

@sckott does ROpenSci have a standard for this?

ebirdhistorical returns incomplete data

I am trying to retrieve all the ebird data for a region on a specific date. I have either stumbled upon a bug or I am confused how the rebird package works.

library(rebird)
library(dplyr)
library(lubridate)

# pick date
x=as_date("2022-10-04")

# download ebird data
dd<-rebird::ebirdhistorical(loc = "US-CA-087",date = x,key = api_key,fieldSet = "full")

# print all the data associated with my userDisplayName
dd %>% 
    filter(userDisplayName=="Abram Fleishman") %>% 
    as.data.frame

  speciesCode                comName             sciName   locId       locName            obsDt howMany      lat       lng obsValid obsReviewed
1      linspa      Lincoln's Sparrow Melospiza lincolnii L279615 Bethany Curve 2022-10-04 12:15       1 36.95371 -122.0383     TRUE       FALSE
2      orcwar Orange-crowned Warbler  Leiothlypis celata L279615 Bethany Curve 2022-10-04 12:15       1 36.95371 -122.0383     TRUE       FALSE
  locationPrivate      subId subnational2Code subnational2Name subnational1Code subnational1Name countryCode   countryName userDisplayName
1           FALSE S119974903        US-CA-087       Santa Cruz            US-CA       California          US United States Abram Fleishman
2           FALSE S119974903        US-CA-087       Santa Cruz            US-CA       California          US United States Abram Fleishman
          obsId checklistId presenceNoted hasComments firstName  lastName hasRichMedia
1 OBS1532344704     CL22352         FALSE       FALSE     Abram Fleishman        FALSE
2 OBS1532344716     CL22352         FALSE       FALSE     Abram Fleishman        FALSE

The 2 species that are returned were indeed part of checklist S119974903, however, there are 19 other species that are missing from the data retrieved from rebird.

I do not understand how only some of the species are returned, and how would I return the full checklists?

Session Info
> devtools::session_info()
─ Session info ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 setting  value
 version  R version 4.2.1 (2022-06-23 ucrt)
 os       Windows 10 x64 (build 19044)
 system   x86_64, mingw32
 ui       RStudio
 language (EN)
 collate  English_United States.utf8
 ctype    English_United States.utf8
 tz       America/Los_Angeles
 date     2022-10-17
 rstudio  2022.07.1+554 Spotted Wakerobin (desktop)
 pandoc   NAPackages ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 package     * version date (UTC) lib source
 assertthat    0.2.1   2019-03-21 [1] CRAN (R 4.2.1)
 cachem        1.0.6   2021-08-19 [1] CRAN (R 4.2.1)
 callr         3.7.1   2022-07-13 [1] CRAN (R 4.2.1)
 cli           3.3.0   2022-04-25 [1] CRAN (R 4.2.1)
 colorspace    2.0-3   2022-02-21 [1] CRAN (R 4.2.1)
 crayon        1.5.1   2022-03-26 [1] CRAN (R 4.2.1)
 crosstalk     1.2.0   2021-11-04 [1] CRAN (R 4.2.1)
 curl          4.3.2   2021-06-23 [1] CRAN (R 4.2.1)
 data.table    1.14.2  2021-09-27 [1] CRAN (R 4.2.1)
 DBI           1.1.3   2022-06-18 [1] CRAN (R 4.2.1)
 devtools      2.4.4   2022-07-20 [1] CRAN (R 4.2.1)
 digest        0.6.29  2021-12-01 [1] CRAN (R 4.2.1)
 dplyr       * 1.0.9   2022-04-28 [1] CRAN (R 4.2.1)
 ellipsis      0.3.2   2021-04-29 [1] CRAN (R 4.2.1)
 fansi         1.0.3   2022-03-24 [1] CRAN (R 4.2.1)
 farver        2.1.1   2022-07-06 [1] CRAN (R 4.2.1)
 fastmap       1.1.0   2021-01-25 [1] CRAN (R 4.2.1)
 fs            1.5.2   2021-12-08 [1] CRAN (R 4.2.1)
 generics      0.1.3   2022-07-05 [1] CRAN (R 4.2.1)
 ggplot2     * 3.3.6   2022-05-03 [1] CRAN (R 4.2.1)
 ggrepel     * 0.9.1   2021-01-15 [1] CRAN (R 4.2.1)
 glue          1.6.2   2022-02-24 [1] CRAN (R 4.2.1)
 gtable        0.3.0   2019-03-25 [1] CRAN (R 4.2.1)
 htmltools     0.5.3   2022-07-18 [1] CRAN (R 4.2.1)
 htmlwidgets   1.5.4   2021-09-08 [1] CRAN (R 4.2.1)
 httpuv        1.6.5   2022-01-05 [1] CRAN (R 4.2.1)
 httr          1.4.3   2022-05-04 [1] CRAN (R 4.2.1)
 jsonlite      1.8.0   2022-02-22 [1] CRAN (R 4.2.1)
 labeling      0.4.2   2020-10-20 [1] CRAN (R 4.2.0)
 later         1.3.0   2021-08-18 [1] CRAN (R 4.2.1)
 lattice       0.20-45 2021-09-22 [2] CRAN (R 4.2.1)
 lazyeval      0.2.2   2019-03-15 [1] CRAN (R 4.2.1)
 lifecycle     1.0.1   2021-09-24 [1] CRAN (R 4.2.1)
 lubridate   * 1.8.0   2021-10-07 [1] CRAN (R 4.2.1)
 magrittr      2.0.3   2022-03-30 [1] CRAN (R 4.2.1)
 Matrix        1.4-1   2022-03-23 [2] CRAN (R 4.2.1)
 memoise       2.0.1   2021-11-26 [1] CRAN (R 4.2.1)
 mgcv          1.8-40  2022-03-29 [2] CRAN (R 4.2.1)
 mime          0.12    2021-09-28 [1] CRAN (R 4.2.0)
 miniUI        0.1.1.1 2018-05-18 [1] CRAN (R 4.2.1)
 munsell       0.5.0   2018-06-12 [1] CRAN (R 4.2.1)
 nlme          3.1-157 2022-03-25 [2] CRAN (R 4.2.1)
 patchwork   * 1.1.1   2020-12-17 [1] CRAN (R 4.2.1)
 pillar        1.8.0   2022-07-18 [1] CRAN (R 4.2.1)
 pkgbuild      1.3.1   2021-12-20 [1] CRAN (R 4.2.1)
 pkgconfig     2.0.3   2019-09-22 [1] CRAN (R 4.2.1)
 pkgload       1.3.0   2022-06-27 [1] CRAN (R 4.2.1)
 plotly      * 4.10.0  2021-10-09 [1] CRAN (R 4.2.1)
 prettyunits   1.1.1   2020-01-24 [1] CRAN (R 4.2.1)
 processx      3.7.0   2022-07-07 [1] CRAN (R 4.2.1)
 profvis       0.3.7   2020-11-02 [1] CRAN (R 4.2.1)
 promises      1.2.0.1 2021-02-11 [1] CRAN (R 4.2.1)
 ps            1.7.1   2022-06-18 [1] CRAN (R 4.2.1)
 purrr       * 0.3.4   2020-04-17 [1] CRAN (R 4.2.1)
 R6            2.5.1   2021-08-19 [1] CRAN (R 4.2.1)
 ragg          1.2.2   2022-02-21 [1] CRAN (R 4.2.1)
 Rcpp          1.0.9   2022-07-08 [1] CRAN (R 4.2.1)
 rebird      * 1.3.0   2021-09-20 [1] CRAN (R 4.2.1)
 remotes       2.4.2   2021-11-30 [1] CRAN (R 4.2.1)
 rlang         1.0.4   2022-07-12 [1] CRAN (R 4.2.1)
 rstudioapi    0.13    2020-11-12 [1] CRAN (R 4.2.1)
 scales        1.2.0   2022-04-13 [1] CRAN (R 4.2.1)
 sessioninfo   1.2.2   2021-12-06 [1] CRAN (R 4.2.1)
 shiny         1.7.2   2022-07-19 [1] CRAN (R 4.2.1)
 stringi       1.7.8   2022-07-11 [1] CRAN (R 4.2.1)
 stringr       1.4.0   2019-02-10 [1] CRAN (R 4.2.1)
 systemfonts   1.0.4   2022-02-11 [1] CRAN (R 4.2.1)
 textshaping   0.3.6   2021-10-13 [1] CRAN (R 4.2.1)
 tibble        3.1.8   2022-07-22 [1] CRAN (R 4.2.1)
 tidyr       * 1.2.0   2022-02-01 [1] CRAN (R 4.2.1)
 tidyselect    1.1.2   2022-02-21 [1] CRAN (R 4.2.1)
 urlchecker    1.0.1   2021-11-30 [1] CRAN (R 4.2.1)
 usethis       2.1.6   2022-05-25 [1] CRAN (R 4.2.1)
 utf8          1.2.2   2021-07-24 [1] CRAN (R 4.2.1)
 vctrs         0.4.1   2022-04-13 [1] CRAN (R 4.2.1)
 viridisLite   0.4.0   2021-04-13 [1] CRAN (R 4.2.1)
 withr         2.5.0   2022-03-03 [1] CRAN (R 4.2.1)
 xtable        1.8-4   2019-04-21 [1] CRAN (R 4.2.1)
 yaml          2.3.5   2022-02-21 [1] CRAN (R 4.2.0)
 zoo           1.8-10  2022-04-15 [1] CRAN (R 4.2.1)

 [1] C:/Users/ConservationMetrics/AppData/Local/R/win-library/4.2
 [2] C:/Program Files/R/R-4.2.1/library

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.