diff --git a/DESCRIPTION b/DESCRIPTION index 9bdd515..a4a300e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: rebird -Version: 1.0.2 +Version: 1.0.3 Title: R Client for the eBird Database of Bird Observations Description: A programmatic client for the eBird database, including functions for searching for bird observations by geographic location (latitude, @@ -29,7 +29,7 @@ Suggests: knitr, testthat, covr -RoxygenNote: 6.1.0 +RoxygenNote: 6.1.1 X-schema.org-applicationCategory: Data Access X-schema.org-keywords: birds, birding, ebird, database, data, biology, observations, sightings, ornithology X-schema.org-isPartOf: https://ropensci.org diff --git a/NAMESPACE b/NAMESPACE index 4ac75c9..580bd46 100755 --- a/NAMESPACE +++ b/NAMESPACE @@ -2,6 +2,7 @@ export(ebirdfreq) export(ebirdgeo) +export(ebirdhistorical) export(ebirdhotspot) export(ebirdloc) export(ebirdnotable) diff --git a/NEWS.md b/NEWS.md index f53b34f..3d49073 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,7 @@ rebird 1.1.0 =================== * Updated `ebirdregioninfo()` to also provide information of hotspots (thanks @gbabineau, #72). +* Added `ebirdhistorical()` which provides historic observations on a date at a region or hotspot (thanks @gbabineau, #74). rebird 1.0.0 =================== diff --git a/R/ebirdhistorical.R b/R/ebirdhistorical.R new file mode 100644 index 0000000..8036338 --- /dev/null +++ b/R/ebirdhistorical.R @@ -0,0 +1,93 @@ +#' Historic observations on a date at a region or hotspot +#' +#' Returns sighting information reported in a given region or hotspot +#' +#' @param loc (required) Region code or locID (if a hotspot). Region code can +#' be country code (e.g. "US"), subnational1 code (states/provinces, e.g. "US-NV"), or +#' subnational2 code (counties, e.g. "US-VA-003"). +#' @param date (required) Date of historic observation date formatted according +#' to ISO 8601 (e.g. 'YYYY-MM-DD', or 'YYYY-MM-DD hh:mm'). Hours and minutes +#' are excluded. +#' @param sortKey [mrec|create] Whether to order results by latest +#' observation date or by latest creation date. The default is by observation date. +#' @param categories [domestic|form|hybrid|intergrade|issf|slash|species|spuh] +#' This is useful for limiting results to certain taxonomic categories. The +#' default is all. Multiple categories may be comma-separated. +#' @param max Maximum number of result rows to return in this request. +#' (A number between 1 and 10000. The default is 10000) +#' @param fieldSet [simple|full] This is set to restrict results to either all +#' or a subset of sighting fields. The default is simple. +#' @param provisional Should flagged records that have not been reviewed +#' be included? +#' @param limitToHotspots Should results be limited to sightings at birding hotspots? +#' The default is FALSE. +#' @param sleep Time (in seconds) before function sends API call. The defaults is +#' zero. Set this to a higher number if you are using this function in a loop with +#' many API calls. +#' @param key eBird API key. You can obtain one from https://ebird.org/api/keygen. +#' We strongly recommend storing it in your \code{.Renviron} file as an +#' environment variable called \code{EBIRD_KEY}. +#' @param ... Curl options passed on to \code{\link[httr]{GET}}. +#' @return A data.frame containing the collected information: +#' @return "speciesCode": species codes +#' @return "comName": species common names +#' @return "sciName" species' scientific names +#' @return "locID": unique identifier for the locations +#' @return "locName": location name +#' @return "obsDt": observation date formatted according to ISO 8601 +#' (e.g. 'YYYY-MM-DD', or 'YYYY-MM-DD hh:mm'). Hours and minutes are excluded +#' if the observer did not report an observation time +#' @return "obsValid": TRUE if observation has been deemed valid by either the +#' automatic filters or a regional viewer, FALSE otherwise +#' @return "obsReviewed": TRUE if observation has been reviewed, FALSE otherwise +#' @return "locationPrivate": TRUE if location is not a birding hotspot +#' @return "subnational2Code": county code (returned if simple=FALSE) +#' @return "subnational2Name": county name (returned if simple=FALSE) +#' @return "subnational1Code": state/province ISO code (returned if simple=FALSE) +#' @return "subnational1Name": state/province name (returned if simple=FALSE) +#' @return "countryCode": country ISO code (returned if simple=FALSE) +#' @return "countryName": country name (returned if simple=FALSE) +#' @return "userDisplayName": first and last name of the observer (returned if simple=FALSE) +#' @return "subID": submission ID (returned if simple=FALSE) +#' @return "obsID": observation ID (returned if simple=FALSE) +#' @return "checklistID": checklist ID (returned if simple=FALSE) +#' @return "presenceNoted": 'true' if user marked presence but did not count the +#' number of birds. 'false' otherwise (returned if simple=FALSE) +#' @return "hasComments": 'true' if comments are included (returned if simple=FALSE) +#' @return "hasRichMedia": 'true' if rich media (e.g. photos/sounds) are included (returned if simple=FALSE) +#' @return "firstName": observer's first name (returned if simple=FALSE) +#' @return "lastName": observer's last name (returned if simple=FALSE) +#' @export +#' @examples \dontrun{ +#' ebirdhistorical(loc = 'US-VA-003', date='2019-02-14',max=10) +#' ebirdhistorical(loc = 'L196159', date='2019-02-14', fieldSet='full') +#' } +#' @author Guy Babineau \email{guy.babineau@@gmail.com} +#' @references \url{http://ebird.org/} +ebirdhistorical <- function(loc, date, sortKey = 'mrec', categories = 'all', + max = 10000, fieldSet='simple', provisional = FALSE, limitToHotspots = FALSE, sleep=0, + key=NULL, ...) +{ + + + historicDate=as.Date(date) + if (Sys.Date() - + # rebird: wrapper to the eBird API -[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](http://www.repostatus.org/badges/latest/active.svg)](http://www.repostatus.org/#active) -[![Build Status](https://api.travis-ci.org/ropensci/rebird.png)](https://travis-ci.org/ropensci/rebird) -[![Build status](https://ci.appveyor.com/api/projects/status/s3dobn991c20t2kg?svg=true)](https://ci.appveyor.com/project/sckott/rebird) -[![cran checks](https://cranchecks.info/badges/worst/rebird)](https://cranchecks.info/pkgs/rebird) -[![Coverage Status](https://coveralls.io/repos/ropensci/rebird/badge.svg)](https://coveralls.io/r/ropensci/rebird) -[![rstudio mirror downloads](http://cranlogs.r-pkg.org/badges/rebird)](https://github.com/metacran/cranlogs.app) -[![cran version](http://www.r-pkg.org/badges/version/rebird)](https://cran.r-project.org/package=rebird/) +[![Project Status: Active – The project has reached a stable, usable +state and is being actively +developed.](http://www.repostatus.org/badges/latest/active.svg)](http://www.repostatus.org/#active) +[![Build +Status](https://api.travis-ci.org/ropensci/rebird.png)](https://travis-ci.org/ropensci/rebird) +[![Build +status](https://ci.appveyor.com/api/projects/status/s3dobn991c20t2kg?svg=true)](https://ci.appveyor.com/project/sckott/rebird) +[![cran +checks](https://cranchecks.info/badges/worst/rebird)](https://cranchecks.info/pkgs/rebird) +[![Coverage +Status](https://coveralls.io/repos/ropensci/rebird/badge.svg)](https://coveralls.io/r/ropensci/rebird) +[![rstudio mirror +downloads](http://cranlogs.r-pkg.org/badges/rebird)](https://github.com/metacran/cranlogs.app) +[![cran +version](http://www.r-pkg.org/badges/version/rebird)](https://cran.r-project.org/package=rebird/) `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: http://www.ebird.org +eBird is a real-time, online bird checklist program. For more +information, visit their website: -The API for the eBird webservices can be accessed here: https://documenter.getpostman.com/view/664302/ebird-api-20/2HTbHW +The API for the eBird webservices can be accessed here: + ## Install You can install the stable version from CRAN - -```r +``` r install.packages("rebird") ``` Or the development version from Github - -```r +``` r install.packages("devtools") devtools::install_github("ropensci/rebird") ``` - # Direct use of `rebird` Load the package: - -```r +``` r library("rebird") ``` -The [eBird API server](https://documenter.getpostman.com/view/664302/ebird-api-20/2HTbHW) -has been updated and thus there are a couple major changes in the way `rebird` works. -API requests to eBird now require 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 . - -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 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: - - -```r +The [eBird API +server](https://documenter.getpostman.com/view/664302/ebird-api-20/2HTbHW) +has been updated and thus there are a couple major changes in the way +`rebird` works. API requests to eBird now require 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 +. + +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 + 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: + +``` r 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. - +The `species_code` function can be called within other `rebird` +functions, or the species code can be specified directly. ## Sightings at location determined by latitude/longitude Search for bird occurrences by latitude and longitude point - -```r +``` r ebirdgeo(species = species_code('spinus tristis'), lat = 42, lng = -76) #> American Goldfinch (Spinus tristis): amegfi -#> # A tibble: 22 x 12 +#> # A tibble: 18 x 12 #> speciesCode comName sciName locId locName obsDt howMany lat lng #> -#> 1 amegfi Americ… Spinus… L814… Woodbo… 2019… 12 41.8 -75.9 -#> 2 amegfi Americ… Spinus… L846… 31 Pul… 2019… 6 42.2 -76.2 -#> 3 amegfi Americ… Spinus… L520… US-PA-… 2019… 7 41.8 -75.8 -#> 4 amegfi Americ… Spinus… L845… 6106 P… 2019… 3 41.9 -75.7 -#> 5 amegfi Americ… Spinus… L197… esther… 2019… 1 42.1 -75.9 -#> 6 amegfi Americ… Spinus… L465… US-New… 2019… 4 42.2 -75.9 -#> 7 amegfi Americ… Spinus… L852… 5051–5… 2019… 4 42.1 -76.3 -#> 8 amegfi Americ… Spinus… L179… Joyce … 2019… 3 41.8 -75.9 -#> 9 amegfi Americ… Spinus… L184… 325 De… 2019… 2 42.2 -76.0 -#> 10 amegfi Americ… Spinus… L692… 7 Rive… 2019… 6 42.1 -76.3 -#> # … with 12 more rows, and 3 more variables: obsValid , -#> # obsReviewed , locationPrivate +#> 1 amegfi Americ… Spinus… L116… Bruce … 2019… 1 41.9 -75.8 +#> 2 amegfi Americ… Spinus… L465… US-New… 2019… 1 42.2 -75.9 +#> 3 amegfi Americ… Spinus… L884… 469–59… 2019… 2 41.8 -75.9 +#> 4 amegfi Americ… Spinus… L217… Vestal 2019… 2 42.1 -76.0 +#> 5 amegfi Americ… Spinus… L870… 325 De… 2019… 1 42.2 -76.0 +#> 6 amegfi Americ… Spinus… L209… Aquate… 2019… 1 42.0 -75.9 +#> 7 amegfi Americ… Spinus… L229… Imperi… 2019… 1 42.1 -76.0 +#> 8 amegfi Americ… Spinus… L212… Chenan… 2019… 1 42.2 -75.8 +#> 9 amegfi Americ… Spinus… L885… 5051–5… 2019… 2 42.1 -76.3 +#> 10 amegfi Americ… Spinus… L978… Murphy… 2019… 6 42.1 -76.0 +#> 11 amegfi Americ… Spinus… L275… "Home " 2019… 5 42.1 -76.0 +#> 12 amegfi Americ… Spinus… L179… Joyce … 2019… 2 41.8 -75.9 +#> 13 amegfi Americ… Spinus… L884… 5126–5… 2019… 1 42.1 -76.3 +#> 14 amegfi Americ… Spinus… L620… Univer… 2019… 1 42.1 -76.0 +#> 15 amegfi Americ… Spinus… L320… Hillcr… 2019… 2 42.2 -75.9 +#> 16 amegfi Americ… Spinus… L197… esther… 2019… 4 42.1 -75.9 +#> 17 amegfi Americ… Spinus… L447… Bingha… 2019… 1 42.1 -76.0 +#> 18 amegfi Americ… Spinus… L207… Workwa… 2019… 2 42.1 -75.9 +#> # … with 3 more variables: obsValid , obsReviewed , +#> # locationPrivate ``` ## Recent observations at a region Search for bird occurrences by region and species name - -```r +``` r ebirdregion(loc = 'US', species = 'btbwar') -#> # A tibble: 24 x 12 +#> # A tibble: 37 x 12 #> speciesCode comName sciName locId locName obsDt howMany lat lng #> -#> 1 btbwar Black-… Setoph… L835… My yard 2019… 1 39.9 -74.8 -#> 2 btbwar Black-… Setoph… L127… Fort Z… 2019… 1 24.5 -81.8 -#> 3 btbwar Black-… Setoph… L128… Zoo Mi… 2019… 1 25.6 -80.4 -#> 4 btbwar Black-… Setoph… L132… FSPSP-… 2019… 1 26.0 -81.5 -#> 5 btbwar Black-… Setoph… L630… Dania … 2019… 1 26.1 -80.2 -#> 6 btbwar Black-… Setoph… L580… No Nam… 2019… 1 24.7 -81.3 -#> 7 btbwar Black-… Setoph… L127… Mathes… 2019… 1 25.7 -80.3 -#> 8 btbwar Black-… Setoph… L850… Martin… 2019… 1 25.8 -80.2 -#> 9 btbwar Black-… Setoph… L707… Fakaha… 2019… 1 26.1 -81.4 -#> 10 btbwar Black-… Setoph… L191… Villag… 2019… 1 25.5 -80.5 -#> # … with 14 more rows, and 3 more variables: obsValid , +#> 1 btbwar Black-… Setoph… L835… Florid… 2019… 1 25.8 -80.4 +#> 2 btbwar Black-… Setoph… L127… J. N. … 2019… 1 26.4 -82.1 +#> 3 btbwar Black-… Setoph… L129… Lantan… 2019… 1 26.6 -80.0 +#> 4 btbwar Black-… Setoph… L835… My yard 2019… 1 39.9 -74.8 +#> 5 btbwar Black-… Setoph… L127… Mead B… 2019… 1 28.6 -81.4 +#> 6 btbwar Black-… Setoph… L127… Castel… 2019… 1 25.6 -80.5 +#> 7 btbwar Black-… Setoph… L200… A. D. … 2019… 1 25.7 -80.3 +#> 8 btbwar Black-… Setoph… L246… Green … 2019… 1 26.5 -80.2 +#> 9 btbwar Black-… Setoph… L885… 2–198 … 2019… 1 26.6 -80.1 +#> 10 btbwar Black-… Setoph… L507… Bay St… 2019… 1 27.2 -82.5 +#> # … with 27 more rows, and 3 more variables: obsValid , #> # obsReviewed , locationPrivate ``` - ## Recent observations at hotspots Search for bird occurrences by a given hotspot - -```r +``` r ebirdregion(loc = 'L99381') -#> # A tibble: 19 x 12 +#> # A tibble: 77 x 12 #> speciesCode comName sciName locId locName obsDt howMany lat lng #> -#> 1 commer Common… Mergus… L993… Stewar… 2019… 50 42.5 -76.5 -#> 2 duck1 duck s… Anatin… L993… Stewar… 2019… 100 42.5 -76.5 -#> 3 rocpig Rock P… Columb… L993… Stewar… 2019… 25 42.5 -76.5 -#> 4 larus1 Larus … Larus … L993… Stewar… 2019… 800 42.5 -76.5 -#> 5 whbnut White-… Sitta … L993… Stewar… 2019… 2 42.5 -76.5 -#> 6 brncre Brown … Certhi… L993… Stewar… 2019… 1 42.5 -76.5 -#> 7 blujay Blue J… Cyanoc… L993… Stewar… 2019… 1 42.5 -76.5 -#> 8 bkcchi Black-… Poecil… L993… Stewar… 2019… 1 42.5 -76.5 -#> 9 eursta Europe… Sturnu… L993… Stewar… 2019… 1 42.5 -76.5 -#> 10 houspa House … Passer… L993… Stewar… 2019… 1 42.5 -76.5 -#> 11 cangoo Canada… Branta… L993… Stewar… 2019… 1000 42.5 -76.5 -#> 12 redhea Redhead Aythya… L993… Stewar… 2019… 1000 42.5 -76.5 -#> 13 ribgul Ring-b… Larus … L993… Stewar… 2019… 1 42.5 -76.5 -#> 14 gbbgul Great … Larus … L993… Stewar… 2019… 2 42.5 -76.5 -#> 15 baleag Bald E… Haliae… L993… Stewar… 2019… 1 42.5 -76.5 -#> 16 rethaw Red-ta… Buteo … L993… Stewar… 2019… 1 42.5 -76.5 -#> 17 amecro Americ… Corvus… L993… Stewar… 2019… 2 42.5 -76.5 -#> 18 mallar3 Mallard Anas p… L993… Stewar… 2019… 1 42.5 -76.5 -#> 19 hergul Herrin… Larus … L993… Stewar… 2019… 2 42.5 -76.5 -#> # … with 3 more variables: obsValid , obsReviewed , -#> # locationPrivate +#> 1 cangoo Canada… Branta… L993… Stewar… 2019… 750 42.5 -76.5 +#> 2 wooduc Wood D… Aix sp… L993… Stewar… 2019… 5 42.5 -76.5 +#> 3 amewig Americ… Mareca… L993… Stewar… 2019… 2 42.5 -76.5 +#> 4 mallar3 Mallard Anas p… L993… Stewar… 2019… 60 42.5 -76.5 +#> 5 ambduc Americ… Anas r… L993… Stewar… 2019… 18 42.5 -76.5 +#> 6 norpin Northe… Anas a… L993… Stewar… 2019… 2 42.5 -76.5 +#> 7 gnwtea Green-… Anas c… L993… Stewar… 2019… 2 42.5 -76.5 +#> 8 redhea Redhead Aythya… L993… Stewar… 2019… 3 42.5 -76.5 +#> 9 rinduc Ring-n… Aythya… L993… Stewar… 2019… 48 42.5 -76.5 +#> 10 lessca Lesser… Aythya… L993… Stewar… 2019… 40 42.5 -76.5 +#> # … with 67 more rows, and 3 more variables: obsValid , +#> # obsReviewed , locationPrivate ``` ## Nearest observations of a species -Search for a species' occurrences near a given latitude and longitude - +Search for a species’ occurrences near a given latitude and longitude -```r +``` r nearestobs(species_code('branta canadensis'), 42, -76) #> Canada Goose (Branta canadensis): cangoo -#> # A tibble: 20 x 12 +#> # A tibble: 69 x 12 #> speciesCode comName sciName locId locName obsDt howMany lat lng #> -#> 1 cangoo Canada… Branta… L789… Bingha… 2019… 13 42.1 -76.0 -#> 2 cangoo Canada… Branta… L852… 5051–5… 2019… 80 42.1 -76.3 -#> 3 cangoo Canada… Branta… L464… Port D… 2019… 47 42.1 -75.9 -#> 4 cangoo Canada… Branta… L186… Cheri … 2019… 1 42.1 -75.9 -#> 5 cangoo Canada… Branta… L505… Boland… 2019… 11 42.2 -75.9 -#> 6 cangoo Canada… Branta… L468… "Bolan… 2019… 16 42.2 -75.9 -#> 7 cangoo Canada… Branta… L191… Colema… 2019… 8 42.0 -76.0 -#> 8 cangoo Canada… Branta… L201… Conflu… 2019… 10 42.1 -76.3 -#> 9 cangoo Canada… Branta… L282… Otsini… 2019… 25 42.1 -75.9 -#> 10 cangoo Canada… Branta… L501… Willia… 2019… 30 42.1 -76.0 -#> 11 cangoo Canada… Branta… L242… Port D… 2019… 38 42.1 -75.9 -#> 12 cangoo Canada… Branta… L296… "Hillc… 2019… 1 42.2 -75.9 -#> 13 cangoo Canada… Branta… L212… Chenan… 2019… 3 42.2 -75.8 -#> 14 cangoo Canada… Branta… L255… Wall S… 2019… 30 42.1 -75.9 -#> 15 cangoo Canada… Branta… L625… 4701 V… 2019… 25 42.1 -76.0 -#> 16 cangoo Canada… Branta… L109… Hillcr… 2019… 10 42.2 -75.9 -#> 17 cangoo Canada… Branta… L350… Day Fa… 2019… 30 42.1 -76.3 -#> 18 cangoo Canada… Branta… L207… Workwa… 2019… 29 42.1 -75.9 -#> 19 cangoo Canada… Branta… L146… Harold… 2019… 8 42.1 -76.0 -#> 20 cangoo Canada… Branta… L674… 5790–5… 2019… 200 42.1 -76.3 -#> # … with 3 more variables: obsValid , obsReviewed , -#> # locationPrivate +#> 1 cangoo Canada… Branta… L166… Chugnu… 2019… 10 42.1 -76.0 +#> 2 cangoo Canada… Branta… L274… River … 2019… NA 42.1 -76.0 +#> 3 cangoo Canada… Branta… L504… Rt. 12… 2019… 30 42.2 -75.9 +#> 4 cangoo Canada… Branta… L271… Flemin… 2019… 26 42.2 -76.2 +#> 5 cangoo Canada… Branta… L201… Conflu… 2019… 10 42.1 -76.3 +#> 6 cangoo Canada… Branta… L100… Brick … 2019… 12 42.1 -76.2 +#> 7 cangoo Canada… Branta… L234… Lockhe… 2019… 75 42.1 -76.2 +#> 8 cangoo Canada… Branta… L255… Wall S… 2019… 3 42.1 -75.9 +#> 9 cangoo Canada… Branta… L978… Murphy… 2019… 25 42.1 -76.0 +#> 10 cangoo Canada… Branta… L582… New Mi… 2019… 6 41.9 -75.7 +#> # … with 59 more rows, and 3 more variables: obsValid , +#> # obsReviewed , locationPrivate ``` - ## Frequency of observations at hotspots or regions Obtain historical frequencies of bird occurrences by hotspot or region - -```r +``` r ebirdfreq(loctype = 'hotspots', loc = 'L196159') -#> # A tibble: 9,168 x 4 +#> # A tibble: 9,216 x 4 #> comName monthQt frequency sampleSize #> #> 1 Snow Goose January-1 0 33 @@ -213,61 +203,110 @@ ebirdfreq(loctype = 'hotspots', loc = 'L196159') #> 8 Blue-winged Teal January-1 0 33 #> 9 Cinnamon Teal January-1 0 33 #> 10 Blue-winged/Cinnamon Teal January-1 0 33 -#> # … with 9,158 more rows +#> # … with 9,206 more rows ``` ## Recent notable sightings Search for notable sightings at a given latitude and longitude - -```r +``` r ebirdnotable(lat = 42, lng = -70) -#> # A tibble: 1,423 x 12 +#> # A tibble: 959 x 12 #> speciesCode comName sciName locId locName obsDt howMany lat lng #> -#> 1 buffle Buffle… Buceph… L849… Bondsv… 2019… 2 42.2 -72.3 -#> 2 bohwax Bohemi… Bombyc… L853… 157 So… 2019… 1 41.9 -70.7 -#> 3 bohwax Bohemi… Bombyc… L853… 157 So… 2019… 1 41.9 -70.7 -#> 4 kineid King E… Somate… L466… Scusse… 2019… 1 41.8 -70.5 -#> 5 kineid King E… Somate… L466… Scusse… 2019… 1 41.8 -70.5 -#> 6 y00478 Icelan… Larus … L667… 1777 M… 2019… 2 42.6 -71.2 -#> 7 kineid King E… Somate… L193… Sandwi… 2019… 1 41.8 -70.5 -#> 8 rinduc Ring-n… Aythya… L853… 3 Pond… 2019… 3 44.1 -69.5 -#> 9 grycat Gray C… Dumete… L251… Horn P… 2019… 1 42.5 -71.2 -#> 10 ruckin Ruby-c… Regulu… L853… 17 N W… 2019… 1 41.4 -71.7 -#> # … with 1,413 more rows, and 3 more variables: obsValid , +#> 1 gwfgoo Greate… Anser … L511… Meadow… 2019… 1 42.4 -72.5 +#> 2 treswa Tree S… Tachyc… L150… Crane … 2019… 2 42.8 -71.0 +#> 3 ruckin Ruby-c… Regulu… L345… Home 2019… 1 42.3 -72.4 +#> 4 yesfli Northe… Colapt… L357… Scarbo… 2019… 1 43.6 -70.4 +#> 5 gwfgoo Greate… Anser … L511… Meadow… 2019… 2 42.4 -72.5 +#> 6 cacgoo1 Cackli… Branta… L511… Meadow… 2019… 1 42.4 -72.5 +#> 7 ruckin Ruby-c… Regulu… L487… Dennis… 2019… 1 41.7 -70.3 +#> 8 yebsap Yellow… Sphyra… L487… Dennis… 2019… 1 41.7 -70.3 +#> 9 chispa Chippi… Spizel… L673… Nashua… 2019… 1 42.7 -71.5 +#> 10 evegro Evenin… Coccot… L357… Dunbac… 2019… 1 42.4 -71.2 +#> # … with 949 more rows, and 3 more variables: obsValid , #> # obsReviewed , locationPrivate ``` or a region - -```r +``` r ebirdnotable(locID = 'US-NY-109') -#> # A tibble: 28 x 12 +#> # A tibble: 92 x 12 #> speciesCode comName sciName locId locName obsDt howMany lat lng #> -#> 1 blkvul Black … Coragy… L179… Taugha… 2019… 3 42.5 -76.6 -#> 2 whwcro White-… Loxia … L852… 538 El… 2019… 3 42.4 -76.4 -#> 3 ruckin Ruby-c… Regulu… L353… Salt P… 2019… 1 42.5 -76.5 -#> 4 evegro Evenin… Coccot… L598… Midlin… 2019… 16 42.4 -76.3 -#> 5 evegro1 Evenin… Coccot… L280… 651 Ha… 2019… 35 42.4 -76.3 -#> 6 osprey Osprey Pandio… L850… 147 My… 2019… 1 42.5 -76.5 -#> 7 chispa Chippi… Spizel… L783… 9 Muri… 2019… 1 42.5 -76.5 -#> 8 evegro3 Evenin… Coccot… L653… 600-63… 2019… 3 42.4 -76.3 -#> 9 evegro3 Evenin… Coccot… L653… 600-63… 2019… 3 42.4 -76.3 -#> 10 evegro Evenin… Coccot… L598… Midlin… 2019… 3 42.4 -76.3 -#> # … with 18 more rows, and 3 more variables: obsValid , +#> 1 osprey Osprey Pandio… L996… Myers … 2019… 1 42.5 -76.6 +#> 2 evegro Evenin… Coccot… L123… Boyer … 2019… 2 42.3 -76.3 +#> 3 snoowl1 Snowy … Bubo s… L887… 86 Dat… 2019… 1 42.6 -76.6 +#> 4 snoowl1 Snowy … Bubo s… L887… Dates … 2019… 1 42.6 -76.6 +#> 5 snoowl1 Snowy … Bubo s… L701… Dates … 2019… 1 42.6 -76.6 +#> 6 osprey1 Osprey… Pandio… L996… Myers … 2019… 1 42.5 -76.6 +#> 7 osprey1 Osprey… Pandio… L996… Myers … 2019… 1 42.5 -76.6 +#> 8 osprey1 Osprey… Pandio… L996… Myers … 2019… 1 42.5 -76.6 +#> 9 snoowl1 Snowy … Bubo s… L887… 1–115 … 2019… 1 42.6 -76.6 +#> 10 snoowl1 Snowy … Bubo s… L887… 86 Dat… 2019… 1 42.6 -76.6 +#> # … with 82 more rows, and 3 more variables: obsValid , #> # obsReviewed , locationPrivate ``` +## Historic Observations + +Search for historic observations on a date at a region + +``` r +ebirdhistorical(loc = 'US-VA-003', date='2019-02-14',max=10) +#> # A tibble: 10 x 12 +#> speciesCode comName sciName locId locName obsDt howMany lat lng +#> +#> 1 cangoo Canada… Branta… L139… Lickin… 2019… 30 38.1 -78.7 +#> 2 mallar3 Mallard Anas p… L139… Lickin… 2019… 5 38.1 -78.7 +#> 3 gnwtea Green-… Anas c… L139… Lickin… 2019… 8 38.1 -78.7 +#> 4 killde Killde… Charad… L139… Lickin… 2019… 1 38.1 -78.7 +#> 5 baleag Bald E… Haliae… L139… Lickin… 2019… 1 38.1 -78.7 +#> 6 belkin1 Belted… Megace… L139… Lickin… 2019… 1 38.1 -78.7 +#> 7 carwre Caroli… Thryot… L139… Lickin… 2019… 1 38.1 -78.7 +#> 8 whtspa White-… Zonotr… L139… Lickin… 2019… 2 38.1 -78.7 +#> 9 norcar Northe… Cardin… L139… Lickin… 2019… 1 38.1 -78.7 +#> 10 canvas Canvas… Aythya… L331… Montic… 2019… 19 38.0 -78.5 +#> # … with 3 more variables: obsValid , obsReviewed , +#> # locationPrivate +``` + +or set of hotspots + +``` r +ebirdhistorical(loc = 'L196159', date='2019-02-14', fieldSet='full') +#> # A tibble: 14 x 27 +#> speciesCode comName sciName locId locName obsDt howMany lat lng +#> +#> 1 annhum Anna's… Calypt… L196… Vancou… 2019… 4 49.3 -123. +#> 2 ribgul Ring-b… Larus … L196… Vancou… 2019… 4 49.3 -123. +#> 3 glwgul Glauco… Larus … L196… Vancou… 2019… 29 49.3 -123. +#> 4 norcro Northw… Corvus… L196… Vancou… 2019… 100 49.3 -123. +#> 5 bkcchi Black-… Poecil… L196… Vancou… 2019… 16 49.3 -123. +#> 6 bushti Bushtit Psaltr… L196… Vancou… 2019… 20 49.3 -123. +#> 7 pacwre1 Pacifi… Troglo… L196… Vancou… 2019… 1 49.3 -123. +#> 8 houfin House … Haemor… L196… Vancou… 2019… 2 49.3 -123. +#> 9 purfin Purple… Haemor… L196… Vancou… 2019… 3 49.3 -123. +#> 10 amegfi Americ… Spinus… L196… Vancou… 2019… 15 49.3 -123. +#> 11 daejun Dark-e… Junco … L196… Vancou… 2019… 37 49.3 -123. +#> 12 sonspa Song S… Melosp… L196… Vancou… 2019… 12 49.3 -123. +#> 13 spotow Spotte… Pipilo… L196… Vancou… 2019… 1 49.3 -123. +#> 14 rewbla Red-wi… Agelai… L196… Vancou… 2019… 6 49.3 -123. +#> # … with 18 more variables: obsValid , obsReviewed , +#> # locationPrivate , subnational2Code , subnational2Name , +#> # subnational1Code , subnational1Name , countryCode , +#> # countryName , userDisplayName , subId , obsId , +#> # checklistId , presenceNoted , hasComments , +#> # hasRichMedia , lastName , firstName +``` + ## Information on a given region or hotspot Obtain detailed information on any valid eBird region - -```r +``` r ebirdregioninfo("CA-BC-GV") #> # A tibble: 1 x 5 #> region minX maxX minY maxY @@ -277,72 +316,95 @@ ebirdregioninfo("CA-BC-GV") or hotspot - -```r +``` r ebirdregioninfo("L196159") -#> # A tibble: 1 x 5 -#> region minX maxX minY maxY -#> -#> 1 Vancouver--Trout Lake (John Hendry Park) -123. -123. 49.2 49.3 +#> # A tibble: 1 x 16 +#> locId name latitude longitude countryCode countryName subnational1Name +#> +#> 1 L196… Vanc… 49.3 -123. CA Canada British Columbia +#> # … with 9 more variables: subnational1Code , subnational2Code , +#> # subnational2Name , isHotspot , locName , lat , +#> # lng , hierarchicalName , locID ``` ## `rebird` and other packages ### How to use `rebird` -This package is part of a richer suite called [spocc - Species Occurrence Data](https://github.com/ropensci/spocc), 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`](https://github.com/CornellLabofOrnithology/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. +This package is part of a richer suite called [spocc - Species +Occurrence Data](https://github.com/ropensci/spocc), 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`](https://github.com/CornellLabofOrnithology/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! +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 -- [x] Recent observations in a region: `ebirdregion()` -- [x] Recent notable observations in a region: `ebirdnotable()` -- [x] Recent observations of a species in a region: `ebirdregion()` -- [x] Recent nearby observations: `ebirdgeo()` -- [x] Recent nearby observations of a species: `ebirdgeo()` -- [x] Nearest observations of a species: `nearestobs()` -- [x] Recent nearby notable observations: `ebirdnotable()` -- [ ] Historic observations on a date + + - \[x\] Recent observations in a region: `ebirdregion()` + - \[x\] Recent notable observations in a region: `ebirdnotable()` + - \[x\] Recent observations of a species in a region: `ebirdregion()` + - \[x\] Recent nearby observations: `ebirdgeo()` + - \[x\] Recent nearby observations of a species: `ebirdgeo()` + - \[x\] Nearest observations of a species: `nearestobs()` + - \[x\] Recent nearby notable observations: `ebirdnotable()` + - \[x\] Historic observations on a date: `ebirdhistorical()` ### product -- [ ] Top 100 -- [ ] Checklist feed on a date -- [ ] Recent checklists feed -- [ ] Regional statistics on a date -- [ ] View Checklist BETA + + - \[ \] Top 100 + - \[ \] Checklist feed on a date + - \[ \] Recent checklists feed + - \[ \] Regional statistics on a date + - \[ \] View Checklist BETA ### ref/geo - - [ ] Adjacent Regions + + - \[ \] Adjacent Regions ### ref/hotspot - - [ ] Hotspots in a region - - [ ] Nearby hotspots + + - \[ \] Hotspots in a region + - \[ \] Nearby hotspots ### ref/taxonomy - - [x] eBird Taxonomy: `ebirdtaxonomy()` - - [ ] Taxonomic Forms - - [ ] Taxonomy Versions - - [ ] Taxonomic Groups + + - \[x\] eBird Taxonomy: `ebirdtaxonomy()` + - \[ \] Taxonomic Forms + - \[ \] Taxonomy Versions + - \[ \] Taxonomic Groups ### ref/region - - [x] Hotspot Info: `ebirdregioninfo()` - - [x] Region Info: `ebirdregioninfo()` - - [ ] Sub Region List + - \[x\] Hotspot Info: `ebirdregioninfo()` + - \[x\] Region Info: `ebirdregioninfo()` + - \[ \] Sub Region List ## Meta -* Please [report any issues or bugs](https://github.com/ropensci/rebird/issues). -* License: MIT -* Get citation information for `rebird` in R doing `citation(package = 'rebird')` - - -[![ropensci_footer](http://ropensci.org/public_images/github_footer.png)](http://ropensci.org) - + - Please [report any issues or + bugs](https://github.com/ropensci/rebird/issues). + - License: MIT + - Get citation information for `rebird` in R doing `citation(package = + 'rebird')` +[![ropensci\_footer](http://ropensci.org/public_images/github_footer.png)](http://ropensci.org) diff --git a/inst/vign/rebird_vignette.Rmd b/inst/vign/rebird_vignette.Rmd index 8aca564..02acfd6 100644 --- a/inst/vign/rebird_vignette.Rmd +++ b/inst/vign/rebird_vignette.Rmd @@ -158,6 +158,19 @@ or a region ebirdnotable(locID = 'US-NY-109') ``` +### Historic Observations + +Search for historic observations on a date at a region + +```{r ebirdhistorical1} +ebirdhistorical(loc = 'US-VA-003', date='2019-02-14',max=10) +``` + +or set of hotspots + +```{r ebirdhistorical2} +ebirdhistorical(loc = 'L196159', date='2019-02-14', fieldSet='full') +``` ### eBird taxonomy diff --git a/inst/vign/rebird_vignette.md b/inst/vign/rebird_vignette.md index bcabd59..633c379 100644 --- a/inst/vign/rebird_vignette.md +++ b/inst/vign/rebird_vignette.md @@ -81,21 +81,24 @@ ebirdgeo(species = species_code('spinus tristis'), lat = 42, lng = -76) ``` ``` -## # A tibble: 23 x 12 +## # A tibble: 13 x 12 ## speciesCode comName sciName locId locName obsDt howMany lat lng ## -## 1 amegfi Americ… Spinus… L465… US-New… 2019… 3 42.2 -75.9 -## 2 amegfi Americ… Spinus… L328… PA-SQ-… 2019… 7 41.8 -75.9 -## 3 amegfi Americ… Spinus… L495… Bingha… 2019… 1 42.1 -76.0 -## 4 amegfi Americ… Spinus… L505… Boland… 2019… 3 42.2 -75.9 -## 5 amegfi Americ… Spinus… L351… Anson … 2019… 11 42.1 -76.1 -## 6 amegfi Americ… Spinus… L184… 325 De… 2019… 3 42.2 -76.0 -## 7 amegfi Americ… Spinus… L524… Victor… 2019… 4 42.1 -76.0 -## 8 amegfi Americ… Spinus… L106… IBM CC… 2019… 9 42.1 -76.0 -## 9 amegfi Americ… Spinus… L572… Scott … 2019… 2 42.1 -76.0 -## 10 amegfi Americ… Spinus… L520… US-PA-… 2019… 25 41.8 -75.8 -## # … with 13 more rows, and 3 more variables: obsValid , -## # obsReviewed , locationPrivate +## 1 amegfi Americ~ Spinus~ L275~ "Home " 2019~ 4 42.1 -76.0 +## 2 amegfi Americ~ Spinus~ L978~ Murphy~ 2019~ 1 42.1 -76.0 +## 3 amegfi Americ~ Spinus~ L884~ 5126–5~ 2019~ 1 42.1 -76.3 +## 4 amegfi Americ~ Spinus~ L465~ US-New~ 2019~ 3 42.2 -75.9 +## 5 amegfi Americ~ Spinus~ L620~ Univer~ 2019~ 1 42.1 -76.0 +## 6 amegfi Americ~ Spinus~ L320~ Hillcr~ 2019~ 2 42.2 -75.9 +## 7 amegfi Americ~ Spinus~ L229~ Imperi~ 2019~ 1 42.1 -76.0 +## 8 amegfi Americ~ Spinus~ L197~ esther~ 2019~ 4 42.1 -75.9 +## 9 amegfi Americ~ Spinus~ L447~ Bingha~ 2019~ 1 42.1 -76.0 +## 10 amegfi Americ~ Spinus~ L207~ Workwa~ 2019~ 2 42.1 -75.9 +## 11 amegfi Americ~ Spinus~ L870~ 325 De~ 2019~ 1 42.2 -76.0 +## 12 amegfi Americ~ Spinus~ L147~ Quaker~ 2019~ 6 42.0 -75.9 +## 13 amegfi Americ~ Spinus~ L866~ Bingha~ 2019~ 3 42.1 -75.9 +## # ... with 3 more variables: obsValid , obsReviewed , +## # locationPrivate ``` Same, but with additional parameter settings, returning only 10 records, including provisional records, and hotspot records. @@ -109,17 +112,17 @@ ebirdgeo(lat = 42, lng = -76, max = 10, includeProvisional = TRUE, hotspot = TRU ## # A tibble: 10 x 12 ## speciesCode comName sciName locId locName obsDt howMany lat lng ## -## 1 amecro Americ… Corvus… L495… Bingha… 2019… 1 42.1 -76.0 -## 2 cangoo Canada… Branta… L146… Harold… 2019… 2 42.1 -76.0 -## 3 commer Common… Mergus… L146… Harold… 2019… 3 42.1 -76.0 -## 4 baleag Bald E… Haliae… L146… Harold… 2019… 1 42.1 -76.0 -## 5 eursta Europe… Sturnu… L146… Harold… 2019… NA 42.1 -76.0 -## 6 gadwal Gadwall Mareca… L505… Boland… 2019… 1 42.2 -75.9 -## 7 mallar3 Mallard Anas p… L505… Boland… 2019… 56 42.2 -75.9 -## 8 ambduc Americ… Anas r… L505… Boland… 2019… 10 42.2 -75.9 -## 9 redhea Redhead Aythya… L505… Boland… 2019… 3 42.2 -75.9 -## 10 grbher3 Great … Ardea … L505… Boland… 2019… 1 42.2 -75.9 -## # … with 3 more variables: obsValid , obsReviewed , +## 1 cangoo Canada~ Branta~ L505~ Boland~ 2019~ 1 42.2 -75.9 +## 2 mallar3 Mallard Anas p~ L505~ Boland~ 2019~ 4 42.2 -75.9 +## 3 ribgul Ring-b~ Larus ~ L505~ Boland~ 2019~ 3 42.2 -75.9 +## 4 baleag Bald E~ Haliae~ L505~ Boland~ 2019~ 2 42.2 -75.9 +## 5 rethaw Red-ta~ Buteo ~ L505~ Boland~ 2019~ 1 42.2 -75.9 +## 6 blujay Blue J~ Cyanoc~ L505~ Boland~ 2019~ 1 42.2 -75.9 +## 7 amecro Americ~ Corvus~ L505~ Boland~ 2019~ 5 42.2 -75.9 +## 8 houfin House ~ Haemor~ L505~ Boland~ 2019~ 1 42.2 -75.9 +## 9 amtspa Americ~ Spizel~ L505~ Boland~ 2019~ 1 42.2 -75.9 +## 10 rewbla Red-wi~ Agelai~ L505~ Boland~ 2019~ 5 42.2 -75.9 +## # ... with 3 more variables: obsValid , obsReviewed , ## # locationPrivate ``` @@ -134,30 +137,21 @@ ebirdregion(loc = 'L99381') ``` ``` -## # A tibble: 19 x 12 +## # A tibble: 54 x 12 ## speciesCode comName sciName locId locName obsDt howMany lat lng ## -## 1 cangoo Canada… Branta… L993… Stewar… 2019… 29 42.5 -76.5 -## 2 mallar3 Mallard Anas p… L993… Stewar… 2019… 2 42.5 -76.5 -## 3 commer Common… Mergus… L993… Stewar… 2019… 18 42.5 -76.5 -## 4 rocpig Rock P… Columb… L993… Stewar… 2019… 2 42.5 -76.5 -## 5 ribgul Ring-b… Larus … L993… Stewar… 2019… 100 42.5 -76.5 -## 6 hergul Herrin… Larus … L993… Stewar… 2019… 150 42.5 -76.5 -## 7 gbbgul Great … Larus … L993… Stewar… 2019… 50 42.5 -76.5 -## 8 merlin Merlin Falco … L993… Stewar… 2019… 1 42.5 -76.5 -## 9 amecro Americ… Corvus… L993… Stewar… 2019… 6 42.5 -76.5 -## 10 redhea Redhead Aythya… L993… Stewar… 2019… NA 42.5 -76.5 -## 11 glagul Glauco… Larus … L993… Stewar… 2019… 1 42.5 -76.5 -## 12 eursta Europe… Sturnu… L993… Stewar… 2019… NA 42.5 -76.5 -## 13 duck1 duck s… Anatin… L993… Stewar… 2019… 100 42.5 -76.5 -## 14 larus1 Larus … Larus … L993… Stewar… 2019… 800 42.5 -76.5 -## 15 whbnut White-… Sitta … L993… Stewar… 2019… 2 42.5 -76.5 -## 16 brncre Brown … Certhi… L993… Stewar… 2019… 1 42.5 -76.5 -## 17 blujay Blue J… Cyanoc… L993… Stewar… 2019… 1 42.5 -76.5 -## 18 bkcchi Black-… Poecil… L993… Stewar… 2019… 1 42.5 -76.5 -## 19 houspa House … Passer… L993… Stewar… 2019… 1 42.5 -76.5 -## # … with 3 more variables: obsValid , obsReviewed , -## # locationPrivate +## 1 cangoo Canada~ Branta~ L993~ Stewar~ 2019~ 200 42.5 -76.5 +## 2 mallar3 Mallard Anas p~ L993~ Stewar~ 2019~ 15 42.5 -76.5 +## 3 ambduc Americ~ Anas r~ L993~ Stewar~ 2019~ 2 42.5 -76.5 +## 4 redhea Redhead Aythya~ L993~ Stewar~ 2019~ 30 42.5 -76.5 +## 5 comgol Common~ Buceph~ L993~ Stewar~ 2019~ 1 42.5 -76.5 +## 6 commer Common~ Mergus~ L993~ Stewar~ 2019~ 10 42.5 -76.5 +## 7 moudov Mourni~ Zenaid~ L993~ Stewar~ 2019~ 1 42.5 -76.5 +## 8 y00475 Americ~ Fulica~ L993~ Stewar~ 2019~ 3 42.5 -76.5 +## 9 killde Killde~ Charad~ L993~ Stewar~ 2019~ 1 42.5 -76.5 +## 10 ribgul Ring-b~ Larus ~ L993~ Stewar~ 2019~ NA 42.5 -76.5 +## # ... with 44 more rows, and 3 more variables: obsValid , +## # obsReviewed , locationPrivate ``` Search by location ID and species name, as well as some additional parameter settings @@ -173,12 +167,11 @@ ebirdregion(loc = 'L99381', species = species_code('larus delawarensis'), ``` ``` -## # A tibble: 1 x 12 -## speciesCode comName sciName locId locName obsDt howMany lat lng -## -## 1 ribgul Ring-b… Larus … L993… Stewar… 2019… 100 42.5 -76.5 -## # … with 3 more variables: obsValid , obsReviewed , -## # locationPrivate +## # A tibble: 1 x 11 +## speciesCode comName sciName locId locName obsDt lat lng obsValid +## +## 1 ribgul Ring-b~ Larus ~ L993~ Stewar~ 2019~ 42.5 -76.5 TRUE +## # ... with 2 more variables: obsReviewed , locationPrivate ``` @@ -196,20 +189,20 @@ nearestobs(species_code('branta canadensis'), 42, -76) ``` ``` -## # A tibble: 26 x 12 +## # A tibble: 46 x 12 ## speciesCode comName sciName locId locName obsDt howMany lat lng ## -## 1 cangoo Canada… Branta… L207… Workwa… 2019… 2 42.1 -75.9 -## 2 cangoo Canada… Branta… L439… Port D… 2019… 43 42.1 -75.9 -## 3 cangoo Canada… Branta… L146… Harold… 2019… 2 42.1 -76.0 -## 4 cangoo Canada… Branta… L505… Boland… 2019… 2 42.2 -75.9 -## 5 cangoo Canada… Branta… L189… Hill P… 2019… 26 42.1 -76.0 -## 6 cangoo Canada… Branta… L696… 5127–5… 2019… 100 42.1 -76.3 -## 7 cangoo Canada… Branta… L809… Port D… 2019… 10 42.1 -75.9 -## 8 cangoo Canada… Branta… L186… Cheri … 2019… 2 42.1 -75.9 -## 9 cangoo Canada… Branta… L212… Chenan… 2019… 2 42.2 -75.8 -## 10 cangoo Canada… Branta… L854… route … 2019… 25 42.1 -76.0 -## # … with 16 more rows, and 3 more variables: obsValid , +## 1 cangoo Canada~ Branta~ L505~ Boland~ 2019~ 1 42.2 -75.9 +## 2 cangoo Canada~ Branta~ L271~ Flemin~ 2019~ 92 42.2 -76.2 +## 3 cangoo Canada~ Branta~ L884~ Rowing~ 2019~ 55 42.1 -76.2 +## 4 cangoo Canada~ Branta~ L201~ Conflu~ 2019~ 16 42.1 -76.3 +## 5 cangoo Canada~ Branta~ L275~ "Home " 2019~ 343 42.1 -76.0 +## 6 cangoo Canada~ Branta~ L212~ Chenan~ 2019~ 33 42.2 -75.8 +## 7 cangoo Canada~ Branta~ L146~ Harold~ 2019~ 625 42.1 -76.0 +## 8 cangoo Canada~ Branta~ L255~ Wall S~ 2019~ 150 42.1 -75.9 +## 9 cangoo Canada~ Branta~ L468~ "Bolan~ 2019~ 2200 42.2 -75.9 +## 10 cangoo Canada~ Branta~ L978~ Murphy~ 2019~ 50 42.1 -76.0 +## # ... with 36 more rows, and 3 more variables: obsValid , ## # obsReviewed , locationPrivate ``` @@ -228,20 +221,20 @@ ebirdregion(loc = 'US', species = species_code('Setophaga caerulescens')) ``` ``` -## # A tibble: 23 x 12 +## # A tibble: 32 x 12 ## speciesCode comName sciName locId locName obsDt howMany lat lng ## -## 1 btbwar Black-… Setoph… L816… Miccos… 2019… 2 25.7 -80.4 -## 2 btbwar Black-… Setoph… L200… A. D. … 2019… 1 25.7 -80.3 -## 3 btbwar Black-… Setoph… L857… Southe… 2019… 1 25.9 -80.2 -## 4 btbwar Black-… Setoph… L246… Green … 2019… 1 26.5 -80.2 -## 5 btbwar Black-… Setoph… L110… Enchan… 2019… 1 25.9 -80.2 -## 6 btbwar Black-… Setoph… L127… Greyno… 2019… 1 25.9 -80.2 -## 7 btbwar Black-… Setoph… L835… My yard 2019… 1 39.9 -74.8 -## 8 btbwar Black-… Setoph… L823… 433 Fi… 2019… 1 28.2 -80.6 -## 9 btbwar Black-… Setoph… L130… Tall C… 2019… 1 26.3 -80.2 -## 10 btbwar Black-… Setoph… L130… 4115 C… 2019… 1 26.2 -80.1 -## # … with 13 more rows, and 3 more variables: obsValid , +## 1 btbwar Black-~ Setoph~ L871~ Schenl~ 2019~ 1 25.7 -80.3 +## 2 btbwar Black-~ Setoph~ L871~ Coral ~ 2019~ 1 25.7 -80.3 +## 3 btbwar Black-~ Setoph~ L835~ My yard 2019~ 1 39.9 -74.8 +## 4 btbwar Black-~ Setoph~ L844~ Kristi~ 2019~ 1 39.9 -74.8 +## 5 btbwar Black-~ Setoph~ L123~ Evergl~ 2019~ 1 25.4 -80.6 +## 6 btbwar Black-~ Setoph~ L129~ Lantan~ 2019~ 1 26.6 -80.0 +## 7 btbwar Black-~ Setoph~ L200~ A. D. ~ 2019~ 1 25.7 -80.3 +## 8 btbwar Black-~ Setoph~ L110~ Enchan~ 2019~ 1 25.9 -80.2 +## 9 btbwar Black-~ Setoph~ L707~ Fakaha~ 2019~ 1 26.1 -81.4 +## 10 btbwar Black-~ Setoph~ L127~ Greyno~ 2019~ 1 25.9 -80.2 +## # ... with 22 more rows, and 3 more variables: obsValid , ## # obsReviewed , locationPrivate ``` @@ -256,17 +249,17 @@ ebirdregion(loc = 'US-OH', max = 10, provisional = TRUE, hotspot = TRUE) ## # A tibble: 10 x 12 ## speciesCode comName sciName locId locName obsDt howMany lat lng ## -## 1 amecro Americ… Corvus… L799… Nimisi… 2019… 1 41.0 -81.5 -## 2 cangoo Canada… Branta… L799… Nimisi… 2019… 3 41.0 -81.5 -## 3 blujay Blue J… Cyanoc… L799… Nimisi… 2019… 3 41.0 -81.5 -## 4 baleag Bald E… Haliae… L799… Nimisi… 2019… 2 41.0 -81.5 -## 5 amerob Americ… Turdus… L150… Buckey… 2019… 2 41.1 -81.9 -## 6 tuftit Tufted… Baeolo… L150… Buckey… 2019… 2 41.1 -81.9 -## 7 norcar Northe… Cardin… L150… Buckey… 2019… 4 41.1 -81.9 -## 8 dowwoo Downy … Dryoba… L150… Buckey… 2019… 2 41.1 -81.9 -## 9 carwre Caroli… Thryot… L150… Buckey… 2019… 1 41.1 -81.9 -## 10 bkcchi Black-… Poecil… L150… Buckey… 2019… 3 41.1 -81.9 -## # … with 3 more variables: obsValid , obsReviewed , +## 1 buffle Buffle~ Buceph~ L216~ Pekin ~ 2019~ 2 41.5 -81.2 +## 2 rewbla Red-wi~ Agelai~ L216~ Pekin ~ 2019~ 5 41.5 -81.2 +## 3 norsho Northe~ Spatul~ L216~ Pekin ~ 2019~ 2 41.5 -81.2 +## 4 norcar Northe~ Cardin~ L216~ Pekin ~ 2019~ 1 41.5 -81.2 +## 5 mallar3 Mallard Anas p~ L216~ Pekin ~ 2019~ 6 41.5 -81.2 +## 6 cangoo Canada~ Branta~ L216~ Pekin ~ 2019~ 40 41.5 -81.2 +## 7 amecro Americ~ Corvus~ L846~ Clear ~ 2019~ 3 40.7 -82.6 +## 8 rinduc Ring-n~ Aythya~ L846~ Clear ~ 2019~ 1 40.7 -82.6 +## 9 rebmer Red-br~ Mergus~ L846~ Clear ~ 2019~ 2 40.7 -82.6 +## 10 doccor Double~ Phalac~ L846~ Clear ~ 2019~ 1 40.7 -82.6 +## # ... with 3 more variables: obsValid , obsReviewed , ## # locationPrivate ``` @@ -281,7 +274,7 @@ ebirdfreq(loctype = 'hotspots', loc = 'L196159') ``` ``` -## # A tibble: 9,168 x 4 +## # A tibble: 9,216 x 4 ## comName monthQt frequency sampleSize ## ## 1 Snow Goose January-1 0 33 @@ -294,7 +287,7 @@ ebirdfreq(loctype = 'hotspots', loc = 'L196159') ## 8 Blue-winged Teal January-1 0 33 ## 9 Cinnamon Teal January-1 0 33 ## 10 Blue-winged/Cinnamon Teal January-1 0 33 -## # … with 9,158 more rows +## # ... with 9,206 more rows ``` Same, but in wide format (for making bar charts) @@ -305,20 +298,20 @@ ebirdfreq(loctype = 'hotspots', loc = 'L196159', long = FALSE) ``` ``` -## # A tibble: 192 x 49 +## # A tibble: 193 x 49 ## comName `January-1` `January-2` `January-3` `January-4` `February-1` ## -## 1 Sample… 33 32 43 112 47 -## 2 Snow G… 0 0 0 0 0 -## 3 Greate… 0 0 0 0 0 -## 4 Cackli… 0 0 0 0 0 -## 5 Canada… 0 0.0312 0.0015 0.107 0.191 -## 6 Cackli… 0 0 0 0 0 -## 7 Trumpe… 0 0 0 0 0 -## 8 Wood D… 0.152 0.0312 0 0.0179 0.0426 -## 9 Blue-w… 0 0 0 0 0 -## 10 Cinnam… 0 0 0 0 0 -## # … with 182 more rows, and 43 more variables: `February-2` , +## 1 Sample~ 33 32 43 113 47 +## 2 Snow G~ 0 0 0 0 0 +## 3 Greate~ 0 0 0 0 0 +## 4 Cackli~ 0 0 0 0 0 +## 5 Canada~ 0 0.0312 0.0015 0.106 0.191 +## 6 Cackli~ 0 0 0 0 0 +## 7 Trumpe~ 0 0 0 0 0 +## 8 Wood D~ 0.152 0.0312 0 0.0177 0.0426 +## 9 Blue-w~ 0 0 0 0 0 +## 10 Cinnam~ 0 0 0 0 0 +## # ... with 183 more rows, and 43 more variables: `February-2` , ## # `February-3` , `February-4` , `March-1` , ## # `March-2` , `March-3` , `March-4` , `April-1` , ## # `April-2` , `April-3` , `April-4` , `May-1` , @@ -345,17 +338,17 @@ ebirdfreq(loctype = 'states', loc = 'CA-BC') ## # A tibble: 35,904 x 4 ## comName monthQt frequency sampleSize ## -## 1 Fulvous Whistling-Duck January… 0 16806 -## 2 Emperor Goose January… 0.0015 16806 -## 3 Snow Goose January… 0.0280 16806 -## 4 Ross's Goose January… 0 16806 -## 5 Snow x Ross's Goose (hybrid) January… 0 16806 -## 6 Snow/Ross's Goose January… 0 16806 -## 7 Swan Goose (Domestic type) January… 0.0000595 16806 -## 8 Graylag x Swan Goose (Domestic type) (hyb… January… 0 16806 -## 9 Greater White-fronted Goose January… 0.00762 16806 -## 10 Pink-footed Goose January… 0 16806 -## # … with 35,894 more rows +## 1 Fulvous Whistling-Duck January~ 0 16832 +## 2 Emperor Goose January~ 0.0015 16832 +## 3 Snow Goose January~ 0.0280 16832 +## 4 Ross's Goose January~ 0 16832 +## 5 Snow x Ross's Goose (hybrid) January~ 0 16832 +## 6 Snow/Ross's Goose January~ 0 16832 +## 7 Swan Goose (Domestic type) January~ 0.0000594 16832 +## 8 Graylag x Swan Goose (Domestic type) (hyb~ January~ 0 16832 +## 9 Greater White-fronted Goose January~ 0.00760 16832 +## 10 Pink-footed Goose January~ 0 16832 +## # ... with 35,894 more rows ``` Or county @@ -369,17 +362,17 @@ ebirdfreq(loctype = 'counties', loc = 'CA-BC-GV') ## # A tibble: 25,008 x 4 ## comName monthQt frequency sampleSize ## -## 1 Emperor Goose January-1 0 5387 -## 2 Snow Goose January-1 0.0639 5387 -## 3 Ross's Goose January-1 0 5387 -## 4 Snow/Ross's Goose January-1 0 5387 -## 5 Greater White-fronted Goose January-1 0.00557 5387 -## 6 Brant January-1 0.0308 5387 -## 7 Cackling Goose January-1 0.0161 5387 -## 8 Canada Goose January-1 0.199 5387 -## 9 Graylag x Canada Goose (hybrid) January-1 0 5387 -## 10 Cackling/Canada Goose January-1 0.00204 5387 -## # … with 24,998 more rows +## 1 Emperor Goose January-1 0 5396 +## 2 Snow Goose January-1 0.0639 5396 +## 3 Ross's Goose January-1 0 5396 +## 4 Snow/Ross's Goose January-1 0 5396 +## 5 Greater White-fronted Goose January-1 0.00556 5396 +## 6 Brant January-1 0.0308 5396 +## 7 Cackling Goose January-1 0.0163 5396 +## 8 Canada Goose January-1 0.199 5396 +## 9 Graylag x Canada Goose (hybrid) January-1 0 5396 +## 10 Cackling/Canada Goose January-1 0.00204 5396 +## # ... with 24,998 more rows ``` Obtain frequency data within a range of years and months @@ -404,7 +397,7 @@ ebirdfreq(loctype = 'hotspots', loc = 'L196159', startyear = 2010, ## 8 Mallard January-1 1 10 ## 9 Northern Pintail January-1 0 10 ## 10 Green-winged Teal January-1 0 10 -## # … with 3,782 more rows +## # ... with 3,782 more rows ``` @@ -418,20 +411,20 @@ ebirdnotable(lat = 42, lng = -70) ``` ``` -## # A tibble: 1,365 x 12 +## # A tibble: 636 x 12 ## speciesCode comName sciName locId locName obsDt howMany lat lng ## -## 1 norsho Northe… Spatul… L279… Shawme… 2019… 1 41.8 -70.5 -## 2 snogoo Snow G… Anser … L857… 2–12 B… 2019… 2 41.3 -70.1 -## 3 norsho Northe… Spatul… L279… Shawme… 2019… 1 41.8 -70.5 -## 4 evegro Evenin… Coccot… L597… Gull P… 2019… 1 42.0 -70.0 -## 5 evegro Evenin… Coccot… L357… Dunbac… 2019… 11 42.4 -71.2 -## 6 truswa Trumpe… Cygnus… L716… Milfor… 2019… 1 42.2 -71.5 -## 7 pinwar Pine W… Setoph… L109… Brunsw… 2019… 1 43.9 -70.0 -## 8 kineid King E… Somate… L318… Ocean … 2019… 1 41.3 -72.1 -## 9 haiwoo2 Hairy … Dryoba… L811… Freepo… 2019… 1 43.8 -70.1 -## 10 lbbgul Lesser… Larus … L919… Agawam… 2019… 1 40.9 -72.4 -## # … with 1,355 more rows, and 3 more variables: obsValid , +## 1 hoared Hoary ~ Acanth~ L360~ Canco ~ 2019~ 1 43.7 -70.3 +## 2 rosgoo Ross's~ Anser ~ L885~ Eastwo~ 2019~ 1 42.3 -72.7 +## 3 eurwig Eurasi~ Mareca~ L827~ Boyd's~ 2019~ 2 41.6 -71.2 +## 4 evegro Evenin~ Coccot~ L691~ Home, ~ 2019~ 25 42.7 -72.2 +## 5 canvas Canvas~ Aythya~ L527~ Great ~ 2019~ 1 43.1 -70.9 +## 6 retloo Red-th~ Gavia ~ L276~ Adams ~ 2019~ 1 43.1 -70.9 +## 7 pingro Pine G~ Pinico~ L884~ (43.84~ 2019~ 7 43.8 -70.1 +## 8 canvas Canvas~ Aythya~ L885~ Osprey~ 2019~ 1 43.1 -70.9 +## 9 redhea Redhead Aythya~ L885~ Osprey~ 2019~ 2 43.1 -70.9 +## 10 pingro Pine G~ Pinico~ L811~ Freepo~ 2019~ 9 43.8 -70.1 +## # ... with 626 more rows, and 3 more variables: obsValid , ## # obsReviewed , locationPrivate ``` @@ -443,23 +436,82 @@ ebirdnotable(locID = 'US-NY-109') ``` ``` -## # A tibble: 25 x 12 +## # A tibble: 67 x 12 ## speciesCode comName sciName locId locName obsDt howMany lat lng ## -## 1 cacgoo1 Cackli… Branta… L856… 1034 H… 2019… 1 42.5 -76.5 -## 2 evegro Evenin… Coccot… L137… Sapsuc… 2019… 1 42.5 -76.5 -## 3 whcspa White-… Zonotr… L398… 14## H… 2019… 1 42.5 -76.5 -## 4 ruckin Ruby-c… Regulu… L996… Myers … 2019… 1 42.5 -76.6 -## 5 evegro Evenin… Coccot… L305… Roy H.… 2019… 2 42.4 -76.3 -## 6 ruckin Ruby-c… Regulu… L353… Salt P… 2019… 1 42.5 -76.5 -## 7 ruckin Ruby-c… Regulu… L353… Salt P… 2019… 1 42.5 -76.5 -## 8 myrwar Yellow… Setoph… L136… Ithaca… 2019… 1 42.4 -76.5 -## 9 evegro Evenin… Coccot… L598… Midlin… 2019… 22 42.4 -76.3 -## 10 evegro Evenin… Coccot… L280… 651 Ha… 2019… 4 42.4 -76.3 -## # … with 15 more rows, and 3 more variables: obsValid , +## 1 gwfgoo2 Greate~ Anser ~ L784~ ** Mon~ 2019~ 4 42.5 -76.4 +## 2 gwfgoo2 Greate~ Anser ~ L879~ Monkey~ 2019~ 4 42.5 -76.4 +## 3 yerwar Yellow~ Setoph~ L113~ Stewar~ 2019~ 1 42.5 -76.5 +## 4 osprey Osprey Pandio~ L205~ NY:TOM~ 2019~ 1 42.5 -76.4 +## 5 evegro Evenin~ Coccot~ L123~ Boyer ~ 2019~ 75 42.3 -76.3 +## 6 thagul Icelan~ Larus ~ L993~ Stewar~ 2019~ 1 42.5 -76.5 +## 7 rosgoo Ross's~ Anser ~ L431~ Cornel~ 2019~ 1 42.4 -76.5 +## 8 rosgoo Ross's~ Anser ~ L356~ Cornel~ 2019~ 1 42.4 -76.5 +## 9 rosgoo Ross's~ Anser ~ L356~ Cornel~ 2019~ 1 42.4 -76.5 +## 10 gwfgoo Greate~ Anser ~ L212~ Caswel~ 2019~ 3 42.5 -76.4 +## # ... with 57 more rows, and 3 more variables: obsValid , ## # obsReviewed , locationPrivate ``` +### Historic Observations + +Search for historic observations on a date at a region + + +```r +ebirdhistorical(loc = 'US-VA-003', date='2019-02-14',max=10) +``` + +``` +## # A tibble: 10 x 12 +## speciesCode comName sciName locId locName obsDt howMany lat lng +## +## 1 cangoo Canada~ Branta~ L139~ Lickin~ 2019~ 30 38.1 -78.7 +## 2 mallar3 Mallard Anas p~ L139~ Lickin~ 2019~ 5 38.1 -78.7 +## 3 gnwtea Green-~ Anas c~ L139~ Lickin~ 2019~ 8 38.1 -78.7 +## 4 killde Killde~ Charad~ L139~ Lickin~ 2019~ 1 38.1 -78.7 +## 5 baleag Bald E~ Haliae~ L139~ Lickin~ 2019~ 1 38.1 -78.7 +## 6 belkin1 Belted~ Megace~ L139~ Lickin~ 2019~ 1 38.1 -78.7 +## 7 carwre Caroli~ Thryot~ L139~ Lickin~ 2019~ 1 38.1 -78.7 +## 8 whtspa White-~ Zonotr~ L139~ Lickin~ 2019~ 2 38.1 -78.7 +## 9 norcar Northe~ Cardin~ L139~ Lickin~ 2019~ 1 38.1 -78.7 +## 10 canvas Canvas~ Aythya~ L331~ Montic~ 2019~ 19 38.0 -78.5 +## # ... with 3 more variables: obsValid , obsReviewed , +## # locationPrivate +``` + +or set of hotspots + + +```r +ebirdhistorical(loc = 'L196159', date='2019-02-14', fieldSet='full') +``` + +``` +## # A tibble: 14 x 27 +## speciesCode comName sciName locId locName obsDt howMany lat lng +## +## 1 annhum Anna's~ Calypt~ L196~ Vancou~ 2019~ 4 49.3 -123. +## 2 ribgul Ring-b~ Larus ~ L196~ Vancou~ 2019~ 4 49.3 -123. +## 3 glwgul Glauco~ Larus ~ L196~ Vancou~ 2019~ 29 49.3 -123. +## 4 norcro Northw~ Corvus~ L196~ Vancou~ 2019~ 100 49.3 -123. +## 5 bkcchi Black-~ Poecil~ L196~ Vancou~ 2019~ 16 49.3 -123. +## 6 bushti Bushtit Psaltr~ L196~ Vancou~ 2019~ 20 49.3 -123. +## 7 pacwre1 Pacifi~ Troglo~ L196~ Vancou~ 2019~ 1 49.3 -123. +## 8 houfin House ~ Haemor~ L196~ Vancou~ 2019~ 2 49.3 -123. +## 9 purfin Purple~ Haemor~ L196~ Vancou~ 2019~ 3 49.3 -123. +## 10 amegfi Americ~ Spinus~ L196~ Vancou~ 2019~ 15 49.3 -123. +## 11 daejun Dark-e~ Junco ~ L196~ Vancou~ 2019~ 37 49.3 -123. +## 12 sonspa Song S~ Melosp~ L196~ Vancou~ 2019~ 12 49.3 -123. +## 13 spotow Spotte~ Pipilo~ L196~ Vancou~ 2019~ 1 49.3 -123. +## 14 rewbla Red-wi~ Agelai~ L196~ Vancou~ 2019~ 6 49.3 -123. +## # ... with 18 more variables: obsValid , obsReviewed , +## # locationPrivate , subnational2Code , subnational2Name , +## # subnational1Code , subnational1Name , countryCode , +## # countryName , userDisplayName , subId , obsId , +## # checklistId , presenceNoted , hasComments , +## # hasRichMedia , lastName , firstName +``` ### eBird taxonomy @@ -474,17 +526,17 @@ ebirdtaxonomy() ## # A tibble: 16,248 x 14 ## sciName comName speciesCode category taxonOrder bandingCodes ## -## 1 Struth… Common… ostric2 species 1 -## 2 Struth… Somali… ostric3 species 6 -## 3 Struth… Common… y00934 slash 7 -## 4 Rhea a… Greate… grerhe1 species 8 -## 5 Rhea p… Lesser… lesrhe2 species 14 -## 6 Rhea p… Lesser… lesrhe4 issf 15 -## 7 Rhea p… Lesser… lesrhe3 issf 18 -## 8 Nothoc… Tawny-… tabtin1 species 19 -## 9 Nothoc… Highla… higtin1 species 20 HITI -## 10 Nothoc… Highla… higtin2 issf 21 -## # … with 16,238 more rows, and 8 more variables: comNameCodes , +## 1 Struth~ Common~ ostric2 species 1 +## 2 Struth~ Somali~ ostric3 species 6 +## 3 Struth~ Common~ y00934 slash 7 +## 4 Rhea a~ Greate~ grerhe1 species 8 +## 5 Rhea p~ Lesser~ lesrhe2 species 14 +## 6 Rhea p~ Lesser~ lesrhe4 issf 15 +## 7 Rhea p~ Lesser~ lesrhe3 issf 18 +## 8 Nothoc~ Tawny-~ tabtin1 species 19 +## 9 Nothoc~ Highla~ higtin1 species 20 HITI +## 10 Nothoc~ Highla~ higtin2 issf 21 +## # ... with 16,238 more rows, and 8 more variables: comNameCodes , ## # sciNameCodes , order , familyComName , ## # familySciName , reportAs , extinct , extinctYear ``` @@ -500,17 +552,17 @@ ebirdtaxonomy(cat = "hybrid") ## # A tibble: 415 x 11 ## sciName comName speciesCode category taxonOrder bandingCodes ## -## 1 Dendro… Spotte… x00721 hybrid 219 -## 2 Dendro… Black-… x00775 hybrid 224 -## 3 Dendro… Black-… x00875 hybrid 226 -## 4 Anser … Snow x… sxrgoo1 hybrid 243 SRGH -## 5 Anser … Grayla… x00776 hybrid 251 -## 6 Anser … Bar-he… x00755 hybrid 259 -## 7 Anser … Snow x… x00627 hybrid 260 -## 8 Anser … Snow G… x00685 hybrid 280 -## 9 Anser … Pink-f… x00756 hybrid 282 -## 10 Anser … Greate… x00757 hybrid 283 -## # … with 405 more rows, and 5 more variables: comNameCodes , +## 1 Dendro~ Spotte~ x00721 hybrid 219 +## 2 Dendro~ Black-~ x00775 hybrid 224 +## 3 Dendro~ Black-~ x00875 hybrid 226 +## 4 Anser ~ Snow x~ sxrgoo1 hybrid 243 SRGH +## 5 Anser ~ Grayla~ x00776 hybrid 251 +## 6 Anser ~ Bar-he~ x00755 hybrid 259 +## 7 Anser ~ Snow x~ x00627 hybrid 260 +## 8 Anser ~ Snow G~ x00685 hybrid 280 +## 9 Anser ~ Pink-f~ x00756 hybrid 282 +## 10 Anser ~ Greate~ x00757 hybrid 283 +## # ... with 405 more rows, and 5 more variables: comNameCodes , ## # sciNameCodes , order , familyComName , ## # familySciName ``` @@ -539,8 +591,12 @@ ebirdregioninfo("L196159") ``` ``` -## # A tibble: 1 x 5 -## region minX maxX minY maxY -## -## 1 Vancouver--Trout Lake (John Hendry Park) -123. -123. 49.2 49.3 +## # A tibble: 1 x 16 +## locId name latitude longitude countryCode countryName subnational1Name +## +## 1 L196~ Vanc~ 49.3 -123. CA Canada British Columbia +## # ... with 9 more variables: subnational1Code , +## # subnational2Code , subnational2Name , isHotspot , +## # locName , lat , lng , hierarchicalName , +## # locID ``` diff --git a/man/ebirdhistorical.Rd b/man/ebirdhistorical.Rd new file mode 100644 index 0000000..06118d8 --- /dev/null +++ b/man/ebirdhistorical.Rd @@ -0,0 +1,118 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/ebirdhistorical.R +\name{ebirdhistorical} +\alias{ebirdhistorical} +\title{Historic observations on a date at a region or hotspot} +\usage{ +ebirdhistorical(loc, date, sortKey = "mrec", categories = "all", + max = 10000, fieldSet = "simple", provisional = FALSE, + limitToHotspots = FALSE, sleep = 0, key = NULL, ...) +} +\arguments{ +\item{loc}{(required) Region code or locID (if a hotspot). Region code can +be country code (e.g. "US"), subnational1 code (states/provinces, e.g. "US-NV"), or +subnational2 code (counties, e.g. "US-VA-003").} + +\item{date}{(required) Date of historic observation date formatted according +to ISO 8601 (e.g. 'YYYY-MM-DD', or 'YYYY-MM-DD hh:mm'). Hours and minutes +are excluded.} + +\item{sortKey}{[mrec|create] Whether to order results by latest +observation date or by latest creation date. The default is by observation date.} + +\item{categories}{[domestic|form|hybrid|intergrade|issf|slash|species|spuh] +This is useful for limiting results to certain taxonomic categories. The +default is all. Multiple categories may be comma-separated.} + +\item{max}{Maximum number of result rows to return in this request. +(A number between 1 and 10000. The default is 10000)} + +\item{fieldSet}{[simple|full] This is set to restrict results to either all +or a subset of sighting fields. The default is simple.} + +\item{provisional}{Should flagged records that have not been reviewed +be included?} + +\item{limitToHotspots}{Should results be limited to sightings at birding hotspots? +The default is FALSE.} + +\item{sleep}{Time (in seconds) before function sends API call. The defaults is +zero. Set this to a higher number if you are using this function in a loop with +many API calls.} + +\item{key}{eBird API key. You can obtain one from https://ebird.org/api/keygen. +We strongly recommend storing it in your \code{.Renviron} file as an +environment variable called \code{EBIRD_KEY}.} + +\item{...}{Curl options passed on to \code{\link[httr]{GET}}.} +} +\value{ +A data.frame containing the collected information: + +"speciesCode": species codes + +"comName": species common names + +"sciName" species' scientific names + +"locID": unique identifier for the locations + +"locName": location name + +"obsDt": observation date formatted according to ISO 8601 + (e.g. 'YYYY-MM-DD', or 'YYYY-MM-DD hh:mm'). Hours and minutes are excluded + if the observer did not report an observation time + +"obsValid": TRUE if observation has been deemed valid by either the + automatic filters or a regional viewer, FALSE otherwise + +"obsReviewed": TRUE if observation has been reviewed, FALSE otherwise + +"locationPrivate": TRUE if location is not a birding hotspot + +"subnational2Code": county code (returned if simple=FALSE) + +"subnational2Name": county name (returned if simple=FALSE) + +"subnational1Code": state/province ISO code (returned if simple=FALSE) + +"subnational1Name": state/province name (returned if simple=FALSE) + +"countryCode": country ISO code (returned if simple=FALSE) + +"countryName": country name (returned if simple=FALSE) + +"userDisplayName": first and last name of the observer (returned if simple=FALSE) + +"subID": submission ID (returned if simple=FALSE) + +"obsID": observation ID (returned if simple=FALSE) + +"checklistID": checklist ID (returned if simple=FALSE) + +"presenceNoted": 'true' if user marked presence but did not count the + number of birds. 'false' otherwise (returned if simple=FALSE) + +"hasComments": 'true' if comments are included (returned if simple=FALSE) + +"hasRichMedia": 'true' if rich media (e.g. photos/sounds) are included (returned if simple=FALSE) + +"firstName": observer's first name (returned if simple=FALSE) + +"lastName": observer's last name (returned if simple=FALSE) +} +\description{ +Returns sighting information reported in a given region or hotspot +} +\examples{ +\dontrun{ +ebirdhistorical(loc = 'US-VA-003', date='2019-02-14',max=10) +ebirdhistorical(loc = 'L196159', date='2019-02-14', fieldSet='full') +} +} +\references{ +\url{http://ebird.org/} +} +\author{ +Guy Babineau \email{guy.babineau@gmail.com} +} diff --git a/tests/testthat/test-ebirdhistorical.R b/tests/testthat/test-ebirdhistorical.R new file mode 100644 index 0000000..33cfe90 --- /dev/null +++ b/tests/testthat/test-ebirdhistorical.R @@ -0,0 +1,56 @@ +context("ebirdhistorical") + +test_that("ebirdhistorical works correctly", { + skip_on_cran() + + out <- ebirdhistorical(loc = 'US-VA-003', date = '2017-03-19') + expect_is(out, "data.frame") + expect_equal(ncol(out), 12) + expect_equal(nrow(out), 66) + + out2 <- ebirdhistorical(loc = 'US-VA-003', date = '2017-03-19',sortKey = 'mrec') + expect_equal(out,out2) + out2 <- ebirdhistorical(loc = 'US-VA-003', date = '2017-03-19', sortKey = 'create') + expect_false(isTRUE(all.equal(out, out2))) + + out2 <- ebirdhistorical(loc = 'US-VA-003', date = '2017-03-19', categories = 'all') + expect_equal(out,out2) + out2 <- ebirdhistorical(loc = 'US-VA-003', date = '2017-03-19', categories = 'spuh') + expect_equal(nrow(out2), 1) + + out2 <- ebirdhistorical(loc = 'US-VA-003', date = '2017-03-19',max = 2) + expect_equal(nrow(out2), 2) + + out2 <- ebirdhistorical(loc = 'US-VA-003', date = '2017-03-19',fieldSet = 'simple') + expect_equal(out,out2) + out2 <- ebirdhistorical(loc = 'US-VA-003', date = '2017-03-19',fieldSet = 'full') + expect_equal(ncol(out2), 27) + + prov1 <- ebirdhistorical(loc = 'US', Sys.Date() - 2) + prov2 <- ebirdhistorical(loc = 'US', Sys.Date() - 2, provisional = FALSE) + expect_equal(prov1,prov2) + prov2 <- ebirdhistorical(loc = 'US', Sys.Date() - 2, provisional = TRUE) + expect_gte(nrow(prov2), nrow(prov1)) + + out2 <- ebirdhistorical(loc = 'US-VA-003', date = '2017-03-19',limitToHotspots = FALSE) + expect_equal(out,out2) + out2 <- ebirdhistorical(loc = 'US-VA-003', date = '2017-03-19', limitToHotspots = TRUE) + expect_equal(nrow(out2), 51) + +}) + +test_that("ebirdhistorical works correctly", { + skip_on_cran() + + expect_error(ebirdhistorical(),"argument \"date\" is missing, with no default") + + expect_error(ebirdhistorical(loc = "US-VA-003"), "argument \"date\" is missing, with no default") + + expect_error(ebirdhistorical(loc = 'US-VA-003', date = Sys.Date() + 1), "date must be in the past") + + expect_error(ebirdhistorical(loc = 'US-VA-003', '1066-10-16'), "date must be on or after 1800-01-01") + + expect_error(suppressWarnings(ebirdhistorical(locID = 'L99381', date = '2017-03-19', sleep = "adf")), + "invalid 'time' value") + +}) diff --git a/vignettes/rebird_vignette.Rmd b/vignettes/rebird_vignette.Rmd index bcabd59..633c379 100644 --- a/vignettes/rebird_vignette.Rmd +++ b/vignettes/rebird_vignette.Rmd @@ -81,21 +81,24 @@ ebirdgeo(species = species_code('spinus tristis'), lat = 42, lng = -76) ``` ``` -## # A tibble: 23 x 12 +## # A tibble: 13 x 12 ## speciesCode comName sciName locId locName obsDt howMany lat lng ## -## 1 amegfi Americ… Spinus… L465… US-New… 2019… 3 42.2 -75.9 -## 2 amegfi Americ… Spinus… L328… PA-SQ-… 2019… 7 41.8 -75.9 -## 3 amegfi Americ… Spinus… L495… Bingha… 2019… 1 42.1 -76.0 -## 4 amegfi Americ… Spinus… L505… Boland… 2019… 3 42.2 -75.9 -## 5 amegfi Americ… Spinus… L351… Anson … 2019… 11 42.1 -76.1 -## 6 amegfi Americ… Spinus… L184… 325 De… 2019… 3 42.2 -76.0 -## 7 amegfi Americ… Spinus… L524… Victor… 2019… 4 42.1 -76.0 -## 8 amegfi Americ… Spinus… L106… IBM CC… 2019… 9 42.1 -76.0 -## 9 amegfi Americ… Spinus… L572… Scott … 2019… 2 42.1 -76.0 -## 10 amegfi Americ… Spinus… L520… US-PA-… 2019… 25 41.8 -75.8 -## # … with 13 more rows, and 3 more variables: obsValid , -## # obsReviewed , locationPrivate +## 1 amegfi Americ~ Spinus~ L275~ "Home " 2019~ 4 42.1 -76.0 +## 2 amegfi Americ~ Spinus~ L978~ Murphy~ 2019~ 1 42.1 -76.0 +## 3 amegfi Americ~ Spinus~ L884~ 5126–5~ 2019~ 1 42.1 -76.3 +## 4 amegfi Americ~ Spinus~ L465~ US-New~ 2019~ 3 42.2 -75.9 +## 5 amegfi Americ~ Spinus~ L620~ Univer~ 2019~ 1 42.1 -76.0 +## 6 amegfi Americ~ Spinus~ L320~ Hillcr~ 2019~ 2 42.2 -75.9 +## 7 amegfi Americ~ Spinus~ L229~ Imperi~ 2019~ 1 42.1 -76.0 +## 8 amegfi Americ~ Spinus~ L197~ esther~ 2019~ 4 42.1 -75.9 +## 9 amegfi Americ~ Spinus~ L447~ Bingha~ 2019~ 1 42.1 -76.0 +## 10 amegfi Americ~ Spinus~ L207~ Workwa~ 2019~ 2 42.1 -75.9 +## 11 amegfi Americ~ Spinus~ L870~ 325 De~ 2019~ 1 42.2 -76.0 +## 12 amegfi Americ~ Spinus~ L147~ Quaker~ 2019~ 6 42.0 -75.9 +## 13 amegfi Americ~ Spinus~ L866~ Bingha~ 2019~ 3 42.1 -75.9 +## # ... with 3 more variables: obsValid , obsReviewed , +## # locationPrivate ``` Same, but with additional parameter settings, returning only 10 records, including provisional records, and hotspot records. @@ -109,17 +112,17 @@ ebirdgeo(lat = 42, lng = -76, max = 10, includeProvisional = TRUE, hotspot = TRU ## # A tibble: 10 x 12 ## speciesCode comName sciName locId locName obsDt howMany lat lng ## -## 1 amecro Americ… Corvus… L495… Bingha… 2019… 1 42.1 -76.0 -## 2 cangoo Canada… Branta… L146… Harold… 2019… 2 42.1 -76.0 -## 3 commer Common… Mergus… L146… Harold… 2019… 3 42.1 -76.0 -## 4 baleag Bald E… Haliae… L146… Harold… 2019… 1 42.1 -76.0 -## 5 eursta Europe… Sturnu… L146… Harold… 2019… NA 42.1 -76.0 -## 6 gadwal Gadwall Mareca… L505… Boland… 2019… 1 42.2 -75.9 -## 7 mallar3 Mallard Anas p… L505… Boland… 2019… 56 42.2 -75.9 -## 8 ambduc Americ… Anas r… L505… Boland… 2019… 10 42.2 -75.9 -## 9 redhea Redhead Aythya… L505… Boland… 2019… 3 42.2 -75.9 -## 10 grbher3 Great … Ardea … L505… Boland… 2019… 1 42.2 -75.9 -## # … with 3 more variables: obsValid , obsReviewed , +## 1 cangoo Canada~ Branta~ L505~ Boland~ 2019~ 1 42.2 -75.9 +## 2 mallar3 Mallard Anas p~ L505~ Boland~ 2019~ 4 42.2 -75.9 +## 3 ribgul Ring-b~ Larus ~ L505~ Boland~ 2019~ 3 42.2 -75.9 +## 4 baleag Bald E~ Haliae~ L505~ Boland~ 2019~ 2 42.2 -75.9 +## 5 rethaw Red-ta~ Buteo ~ L505~ Boland~ 2019~ 1 42.2 -75.9 +## 6 blujay Blue J~ Cyanoc~ L505~ Boland~ 2019~ 1 42.2 -75.9 +## 7 amecro Americ~ Corvus~ L505~ Boland~ 2019~ 5 42.2 -75.9 +## 8 houfin House ~ Haemor~ L505~ Boland~ 2019~ 1 42.2 -75.9 +## 9 amtspa Americ~ Spizel~ L505~ Boland~ 2019~ 1 42.2 -75.9 +## 10 rewbla Red-wi~ Agelai~ L505~ Boland~ 2019~ 5 42.2 -75.9 +## # ... with 3 more variables: obsValid , obsReviewed , ## # locationPrivate ``` @@ -134,30 +137,21 @@ ebirdregion(loc = 'L99381') ``` ``` -## # A tibble: 19 x 12 +## # A tibble: 54 x 12 ## speciesCode comName sciName locId locName obsDt howMany lat lng ## -## 1 cangoo Canada… Branta… L993… Stewar… 2019… 29 42.5 -76.5 -## 2 mallar3 Mallard Anas p… L993… Stewar… 2019… 2 42.5 -76.5 -## 3 commer Common… Mergus… L993… Stewar… 2019… 18 42.5 -76.5 -## 4 rocpig Rock P… Columb… L993… Stewar… 2019… 2 42.5 -76.5 -## 5 ribgul Ring-b… Larus … L993… Stewar… 2019… 100 42.5 -76.5 -## 6 hergul Herrin… Larus … L993… Stewar… 2019… 150 42.5 -76.5 -## 7 gbbgul Great … Larus … L993… Stewar… 2019… 50 42.5 -76.5 -## 8 merlin Merlin Falco … L993… Stewar… 2019… 1 42.5 -76.5 -## 9 amecro Americ… Corvus… L993… Stewar… 2019… 6 42.5 -76.5 -## 10 redhea Redhead Aythya… L993… Stewar… 2019… NA 42.5 -76.5 -## 11 glagul Glauco… Larus … L993… Stewar… 2019… 1 42.5 -76.5 -## 12 eursta Europe… Sturnu… L993… Stewar… 2019… NA 42.5 -76.5 -## 13 duck1 duck s… Anatin… L993… Stewar… 2019… 100 42.5 -76.5 -## 14 larus1 Larus … Larus … L993… Stewar… 2019… 800 42.5 -76.5 -## 15 whbnut White-… Sitta … L993… Stewar… 2019… 2 42.5 -76.5 -## 16 brncre Brown … Certhi… L993… Stewar… 2019… 1 42.5 -76.5 -## 17 blujay Blue J… Cyanoc… L993… Stewar… 2019… 1 42.5 -76.5 -## 18 bkcchi Black-… Poecil… L993… Stewar… 2019… 1 42.5 -76.5 -## 19 houspa House … Passer… L993… Stewar… 2019… 1 42.5 -76.5 -## # … with 3 more variables: obsValid , obsReviewed , -## # locationPrivate +## 1 cangoo Canada~ Branta~ L993~ Stewar~ 2019~ 200 42.5 -76.5 +## 2 mallar3 Mallard Anas p~ L993~ Stewar~ 2019~ 15 42.5 -76.5 +## 3 ambduc Americ~ Anas r~ L993~ Stewar~ 2019~ 2 42.5 -76.5 +## 4 redhea Redhead Aythya~ L993~ Stewar~ 2019~ 30 42.5 -76.5 +## 5 comgol Common~ Buceph~ L993~ Stewar~ 2019~ 1 42.5 -76.5 +## 6 commer Common~ Mergus~ L993~ Stewar~ 2019~ 10 42.5 -76.5 +## 7 moudov Mourni~ Zenaid~ L993~ Stewar~ 2019~ 1 42.5 -76.5 +## 8 y00475 Americ~ Fulica~ L993~ Stewar~ 2019~ 3 42.5 -76.5 +## 9 killde Killde~ Charad~ L993~ Stewar~ 2019~ 1 42.5 -76.5 +## 10 ribgul Ring-b~ Larus ~ L993~ Stewar~ 2019~ NA 42.5 -76.5 +## # ... with 44 more rows, and 3 more variables: obsValid , +## # obsReviewed , locationPrivate ``` Search by location ID and species name, as well as some additional parameter settings @@ -173,12 +167,11 @@ ebirdregion(loc = 'L99381', species = species_code('larus delawarensis'), ``` ``` -## # A tibble: 1 x 12 -## speciesCode comName sciName locId locName obsDt howMany lat lng -## -## 1 ribgul Ring-b… Larus … L993… Stewar… 2019… 100 42.5 -76.5 -## # … with 3 more variables: obsValid , obsReviewed , -## # locationPrivate +## # A tibble: 1 x 11 +## speciesCode comName sciName locId locName obsDt lat lng obsValid +## +## 1 ribgul Ring-b~ Larus ~ L993~ Stewar~ 2019~ 42.5 -76.5 TRUE +## # ... with 2 more variables: obsReviewed , locationPrivate ``` @@ -196,20 +189,20 @@ nearestobs(species_code('branta canadensis'), 42, -76) ``` ``` -## # A tibble: 26 x 12 +## # A tibble: 46 x 12 ## speciesCode comName sciName locId locName obsDt howMany lat lng ## -## 1 cangoo Canada… Branta… L207… Workwa… 2019… 2 42.1 -75.9 -## 2 cangoo Canada… Branta… L439… Port D… 2019… 43 42.1 -75.9 -## 3 cangoo Canada… Branta… L146… Harold… 2019… 2 42.1 -76.0 -## 4 cangoo Canada… Branta… L505… Boland… 2019… 2 42.2 -75.9 -## 5 cangoo Canada… Branta… L189… Hill P… 2019… 26 42.1 -76.0 -## 6 cangoo Canada… Branta… L696… 5127–5… 2019… 100 42.1 -76.3 -## 7 cangoo Canada… Branta… L809… Port D… 2019… 10 42.1 -75.9 -## 8 cangoo Canada… Branta… L186… Cheri … 2019… 2 42.1 -75.9 -## 9 cangoo Canada… Branta… L212… Chenan… 2019… 2 42.2 -75.8 -## 10 cangoo Canada… Branta… L854… route … 2019… 25 42.1 -76.0 -## # … with 16 more rows, and 3 more variables: obsValid , +## 1 cangoo Canada~ Branta~ L505~ Boland~ 2019~ 1 42.2 -75.9 +## 2 cangoo Canada~ Branta~ L271~ Flemin~ 2019~ 92 42.2 -76.2 +## 3 cangoo Canada~ Branta~ L884~ Rowing~ 2019~ 55 42.1 -76.2 +## 4 cangoo Canada~ Branta~ L201~ Conflu~ 2019~ 16 42.1 -76.3 +## 5 cangoo Canada~ Branta~ L275~ "Home " 2019~ 343 42.1 -76.0 +## 6 cangoo Canada~ Branta~ L212~ Chenan~ 2019~ 33 42.2 -75.8 +## 7 cangoo Canada~ Branta~ L146~ Harold~ 2019~ 625 42.1 -76.0 +## 8 cangoo Canada~ Branta~ L255~ Wall S~ 2019~ 150 42.1 -75.9 +## 9 cangoo Canada~ Branta~ L468~ "Bolan~ 2019~ 2200 42.2 -75.9 +## 10 cangoo Canada~ Branta~ L978~ Murphy~ 2019~ 50 42.1 -76.0 +## # ... with 36 more rows, and 3 more variables: obsValid , ## # obsReviewed , locationPrivate ``` @@ -228,20 +221,20 @@ ebirdregion(loc = 'US', species = species_code('Setophaga caerulescens')) ``` ``` -## # A tibble: 23 x 12 +## # A tibble: 32 x 12 ## speciesCode comName sciName locId locName obsDt howMany lat lng ## -## 1 btbwar Black-… Setoph… L816… Miccos… 2019… 2 25.7 -80.4 -## 2 btbwar Black-… Setoph… L200… A. D. … 2019… 1 25.7 -80.3 -## 3 btbwar Black-… Setoph… L857… Southe… 2019… 1 25.9 -80.2 -## 4 btbwar Black-… Setoph… L246… Green … 2019… 1 26.5 -80.2 -## 5 btbwar Black-… Setoph… L110… Enchan… 2019… 1 25.9 -80.2 -## 6 btbwar Black-… Setoph… L127… Greyno… 2019… 1 25.9 -80.2 -## 7 btbwar Black-… Setoph… L835… My yard 2019… 1 39.9 -74.8 -## 8 btbwar Black-… Setoph… L823… 433 Fi… 2019… 1 28.2 -80.6 -## 9 btbwar Black-… Setoph… L130… Tall C… 2019… 1 26.3 -80.2 -## 10 btbwar Black-… Setoph… L130… 4115 C… 2019… 1 26.2 -80.1 -## # … with 13 more rows, and 3 more variables: obsValid , +## 1 btbwar Black-~ Setoph~ L871~ Schenl~ 2019~ 1 25.7 -80.3 +## 2 btbwar Black-~ Setoph~ L871~ Coral ~ 2019~ 1 25.7 -80.3 +## 3 btbwar Black-~ Setoph~ L835~ My yard 2019~ 1 39.9 -74.8 +## 4 btbwar Black-~ Setoph~ L844~ Kristi~ 2019~ 1 39.9 -74.8 +## 5 btbwar Black-~ Setoph~ L123~ Evergl~ 2019~ 1 25.4 -80.6 +## 6 btbwar Black-~ Setoph~ L129~ Lantan~ 2019~ 1 26.6 -80.0 +## 7 btbwar Black-~ Setoph~ L200~ A. D. ~ 2019~ 1 25.7 -80.3 +## 8 btbwar Black-~ Setoph~ L110~ Enchan~ 2019~ 1 25.9 -80.2 +## 9 btbwar Black-~ Setoph~ L707~ Fakaha~ 2019~ 1 26.1 -81.4 +## 10 btbwar Black-~ Setoph~ L127~ Greyno~ 2019~ 1 25.9 -80.2 +## # ... with 22 more rows, and 3 more variables: obsValid , ## # obsReviewed , locationPrivate ``` @@ -256,17 +249,17 @@ ebirdregion(loc = 'US-OH', max = 10, provisional = TRUE, hotspot = TRUE) ## # A tibble: 10 x 12 ## speciesCode comName sciName locId locName obsDt howMany lat lng ## -## 1 amecro Americ… Corvus… L799… Nimisi… 2019… 1 41.0 -81.5 -## 2 cangoo Canada… Branta… L799… Nimisi… 2019… 3 41.0 -81.5 -## 3 blujay Blue J… Cyanoc… L799… Nimisi… 2019… 3 41.0 -81.5 -## 4 baleag Bald E… Haliae… L799… Nimisi… 2019… 2 41.0 -81.5 -## 5 amerob Americ… Turdus… L150… Buckey… 2019… 2 41.1 -81.9 -## 6 tuftit Tufted… Baeolo… L150… Buckey… 2019… 2 41.1 -81.9 -## 7 norcar Northe… Cardin… L150… Buckey… 2019… 4 41.1 -81.9 -## 8 dowwoo Downy … Dryoba… L150… Buckey… 2019… 2 41.1 -81.9 -## 9 carwre Caroli… Thryot… L150… Buckey… 2019… 1 41.1 -81.9 -## 10 bkcchi Black-… Poecil… L150… Buckey… 2019… 3 41.1 -81.9 -## # … with 3 more variables: obsValid , obsReviewed , +## 1 buffle Buffle~ Buceph~ L216~ Pekin ~ 2019~ 2 41.5 -81.2 +## 2 rewbla Red-wi~ Agelai~ L216~ Pekin ~ 2019~ 5 41.5 -81.2 +## 3 norsho Northe~ Spatul~ L216~ Pekin ~ 2019~ 2 41.5 -81.2 +## 4 norcar Northe~ Cardin~ L216~ Pekin ~ 2019~ 1 41.5 -81.2 +## 5 mallar3 Mallard Anas p~ L216~ Pekin ~ 2019~ 6 41.5 -81.2 +## 6 cangoo Canada~ Branta~ L216~ Pekin ~ 2019~ 40 41.5 -81.2 +## 7 amecro Americ~ Corvus~ L846~ Clear ~ 2019~ 3 40.7 -82.6 +## 8 rinduc Ring-n~ Aythya~ L846~ Clear ~ 2019~ 1 40.7 -82.6 +## 9 rebmer Red-br~ Mergus~ L846~ Clear ~ 2019~ 2 40.7 -82.6 +## 10 doccor Double~ Phalac~ L846~ Clear ~ 2019~ 1 40.7 -82.6 +## # ... with 3 more variables: obsValid , obsReviewed , ## # locationPrivate ``` @@ -281,7 +274,7 @@ ebirdfreq(loctype = 'hotspots', loc = 'L196159') ``` ``` -## # A tibble: 9,168 x 4 +## # A tibble: 9,216 x 4 ## comName monthQt frequency sampleSize ## ## 1 Snow Goose January-1 0 33 @@ -294,7 +287,7 @@ ebirdfreq(loctype = 'hotspots', loc = 'L196159') ## 8 Blue-winged Teal January-1 0 33 ## 9 Cinnamon Teal January-1 0 33 ## 10 Blue-winged/Cinnamon Teal January-1 0 33 -## # … with 9,158 more rows +## # ... with 9,206 more rows ``` Same, but in wide format (for making bar charts) @@ -305,20 +298,20 @@ ebirdfreq(loctype = 'hotspots', loc = 'L196159', long = FALSE) ``` ``` -## # A tibble: 192 x 49 +## # A tibble: 193 x 49 ## comName `January-1` `January-2` `January-3` `January-4` `February-1` ## -## 1 Sample… 33 32 43 112 47 -## 2 Snow G… 0 0 0 0 0 -## 3 Greate… 0 0 0 0 0 -## 4 Cackli… 0 0 0 0 0 -## 5 Canada… 0 0.0312 0.0015 0.107 0.191 -## 6 Cackli… 0 0 0 0 0 -## 7 Trumpe… 0 0 0 0 0 -## 8 Wood D… 0.152 0.0312 0 0.0179 0.0426 -## 9 Blue-w… 0 0 0 0 0 -## 10 Cinnam… 0 0 0 0 0 -## # … with 182 more rows, and 43 more variables: `February-2` , +## 1 Sample~ 33 32 43 113 47 +## 2 Snow G~ 0 0 0 0 0 +## 3 Greate~ 0 0 0 0 0 +## 4 Cackli~ 0 0 0 0 0 +## 5 Canada~ 0 0.0312 0.0015 0.106 0.191 +## 6 Cackli~ 0 0 0 0 0 +## 7 Trumpe~ 0 0 0 0 0 +## 8 Wood D~ 0.152 0.0312 0 0.0177 0.0426 +## 9 Blue-w~ 0 0 0 0 0 +## 10 Cinnam~ 0 0 0 0 0 +## # ... with 183 more rows, and 43 more variables: `February-2` , ## # `February-3` , `February-4` , `March-1` , ## # `March-2` , `March-3` , `March-4` , `April-1` , ## # `April-2` , `April-3` , `April-4` , `May-1` , @@ -345,17 +338,17 @@ ebirdfreq(loctype = 'states', loc = 'CA-BC') ## # A tibble: 35,904 x 4 ## comName monthQt frequency sampleSize ## -## 1 Fulvous Whistling-Duck January… 0 16806 -## 2 Emperor Goose January… 0.0015 16806 -## 3 Snow Goose January… 0.0280 16806 -## 4 Ross's Goose January… 0 16806 -## 5 Snow x Ross's Goose (hybrid) January… 0 16806 -## 6 Snow/Ross's Goose January… 0 16806 -## 7 Swan Goose (Domestic type) January… 0.0000595 16806 -## 8 Graylag x Swan Goose (Domestic type) (hyb… January… 0 16806 -## 9 Greater White-fronted Goose January… 0.00762 16806 -## 10 Pink-footed Goose January… 0 16806 -## # … with 35,894 more rows +## 1 Fulvous Whistling-Duck January~ 0 16832 +## 2 Emperor Goose January~ 0.0015 16832 +## 3 Snow Goose January~ 0.0280 16832 +## 4 Ross's Goose January~ 0 16832 +## 5 Snow x Ross's Goose (hybrid) January~ 0 16832 +## 6 Snow/Ross's Goose January~ 0 16832 +## 7 Swan Goose (Domestic type) January~ 0.0000594 16832 +## 8 Graylag x Swan Goose (Domestic type) (hyb~ January~ 0 16832 +## 9 Greater White-fronted Goose January~ 0.00760 16832 +## 10 Pink-footed Goose January~ 0 16832 +## # ... with 35,894 more rows ``` Or county @@ -369,17 +362,17 @@ ebirdfreq(loctype = 'counties', loc = 'CA-BC-GV') ## # A tibble: 25,008 x 4 ## comName monthQt frequency sampleSize ## -## 1 Emperor Goose January-1 0 5387 -## 2 Snow Goose January-1 0.0639 5387 -## 3 Ross's Goose January-1 0 5387 -## 4 Snow/Ross's Goose January-1 0 5387 -## 5 Greater White-fronted Goose January-1 0.00557 5387 -## 6 Brant January-1 0.0308 5387 -## 7 Cackling Goose January-1 0.0161 5387 -## 8 Canada Goose January-1 0.199 5387 -## 9 Graylag x Canada Goose (hybrid) January-1 0 5387 -## 10 Cackling/Canada Goose January-1 0.00204 5387 -## # … with 24,998 more rows +## 1 Emperor Goose January-1 0 5396 +## 2 Snow Goose January-1 0.0639 5396 +## 3 Ross's Goose January-1 0 5396 +## 4 Snow/Ross's Goose January-1 0 5396 +## 5 Greater White-fronted Goose January-1 0.00556 5396 +## 6 Brant January-1 0.0308 5396 +## 7 Cackling Goose January-1 0.0163 5396 +## 8 Canada Goose January-1 0.199 5396 +## 9 Graylag x Canada Goose (hybrid) January-1 0 5396 +## 10 Cackling/Canada Goose January-1 0.00204 5396 +## # ... with 24,998 more rows ``` Obtain frequency data within a range of years and months @@ -404,7 +397,7 @@ ebirdfreq(loctype = 'hotspots', loc = 'L196159', startyear = 2010, ## 8 Mallard January-1 1 10 ## 9 Northern Pintail January-1 0 10 ## 10 Green-winged Teal January-1 0 10 -## # … with 3,782 more rows +## # ... with 3,782 more rows ``` @@ -418,20 +411,20 @@ ebirdnotable(lat = 42, lng = -70) ``` ``` -## # A tibble: 1,365 x 12 +## # A tibble: 636 x 12 ## speciesCode comName sciName locId locName obsDt howMany lat lng ## -## 1 norsho Northe… Spatul… L279… Shawme… 2019… 1 41.8 -70.5 -## 2 snogoo Snow G… Anser … L857… 2–12 B… 2019… 2 41.3 -70.1 -## 3 norsho Northe… Spatul… L279… Shawme… 2019… 1 41.8 -70.5 -## 4 evegro Evenin… Coccot… L597… Gull P… 2019… 1 42.0 -70.0 -## 5 evegro Evenin… Coccot… L357… Dunbac… 2019… 11 42.4 -71.2 -## 6 truswa Trumpe… Cygnus… L716… Milfor… 2019… 1 42.2 -71.5 -## 7 pinwar Pine W… Setoph… L109… Brunsw… 2019… 1 43.9 -70.0 -## 8 kineid King E… Somate… L318… Ocean … 2019… 1 41.3 -72.1 -## 9 haiwoo2 Hairy … Dryoba… L811… Freepo… 2019… 1 43.8 -70.1 -## 10 lbbgul Lesser… Larus … L919… Agawam… 2019… 1 40.9 -72.4 -## # … with 1,355 more rows, and 3 more variables: obsValid , +## 1 hoared Hoary ~ Acanth~ L360~ Canco ~ 2019~ 1 43.7 -70.3 +## 2 rosgoo Ross's~ Anser ~ L885~ Eastwo~ 2019~ 1 42.3 -72.7 +## 3 eurwig Eurasi~ Mareca~ L827~ Boyd's~ 2019~ 2 41.6 -71.2 +## 4 evegro Evenin~ Coccot~ L691~ Home, ~ 2019~ 25 42.7 -72.2 +## 5 canvas Canvas~ Aythya~ L527~ Great ~ 2019~ 1 43.1 -70.9 +## 6 retloo Red-th~ Gavia ~ L276~ Adams ~ 2019~ 1 43.1 -70.9 +## 7 pingro Pine G~ Pinico~ L884~ (43.84~ 2019~ 7 43.8 -70.1 +## 8 canvas Canvas~ Aythya~ L885~ Osprey~ 2019~ 1 43.1 -70.9 +## 9 redhea Redhead Aythya~ L885~ Osprey~ 2019~ 2 43.1 -70.9 +## 10 pingro Pine G~ Pinico~ L811~ Freepo~ 2019~ 9 43.8 -70.1 +## # ... with 626 more rows, and 3 more variables: obsValid , ## # obsReviewed , locationPrivate ``` @@ -443,23 +436,82 @@ ebirdnotable(locID = 'US-NY-109') ``` ``` -## # A tibble: 25 x 12 +## # A tibble: 67 x 12 ## speciesCode comName sciName locId locName obsDt howMany lat lng ## -## 1 cacgoo1 Cackli… Branta… L856… 1034 H… 2019… 1 42.5 -76.5 -## 2 evegro Evenin… Coccot… L137… Sapsuc… 2019… 1 42.5 -76.5 -## 3 whcspa White-… Zonotr… L398… 14## H… 2019… 1 42.5 -76.5 -## 4 ruckin Ruby-c… Regulu… L996… Myers … 2019… 1 42.5 -76.6 -## 5 evegro Evenin… Coccot… L305… Roy H.… 2019… 2 42.4 -76.3 -## 6 ruckin Ruby-c… Regulu… L353… Salt P… 2019… 1 42.5 -76.5 -## 7 ruckin Ruby-c… Regulu… L353… Salt P… 2019… 1 42.5 -76.5 -## 8 myrwar Yellow… Setoph… L136… Ithaca… 2019… 1 42.4 -76.5 -## 9 evegro Evenin… Coccot… L598… Midlin… 2019… 22 42.4 -76.3 -## 10 evegro Evenin… Coccot… L280… 651 Ha… 2019… 4 42.4 -76.3 -## # … with 15 more rows, and 3 more variables: obsValid , +## 1 gwfgoo2 Greate~ Anser ~ L784~ ** Mon~ 2019~ 4 42.5 -76.4 +## 2 gwfgoo2 Greate~ Anser ~ L879~ Monkey~ 2019~ 4 42.5 -76.4 +## 3 yerwar Yellow~ Setoph~ L113~ Stewar~ 2019~ 1 42.5 -76.5 +## 4 osprey Osprey Pandio~ L205~ NY:TOM~ 2019~ 1 42.5 -76.4 +## 5 evegro Evenin~ Coccot~ L123~ Boyer ~ 2019~ 75 42.3 -76.3 +## 6 thagul Icelan~ Larus ~ L993~ Stewar~ 2019~ 1 42.5 -76.5 +## 7 rosgoo Ross's~ Anser ~ L431~ Cornel~ 2019~ 1 42.4 -76.5 +## 8 rosgoo Ross's~ Anser ~ L356~ Cornel~ 2019~ 1 42.4 -76.5 +## 9 rosgoo Ross's~ Anser ~ L356~ Cornel~ 2019~ 1 42.4 -76.5 +## 10 gwfgoo Greate~ Anser ~ L212~ Caswel~ 2019~ 3 42.5 -76.4 +## # ... with 57 more rows, and 3 more variables: obsValid , ## # obsReviewed , locationPrivate ``` +### Historic Observations + +Search for historic observations on a date at a region + + +```r +ebirdhistorical(loc = 'US-VA-003', date='2019-02-14',max=10) +``` + +``` +## # A tibble: 10 x 12 +## speciesCode comName sciName locId locName obsDt howMany lat lng +## +## 1 cangoo Canada~ Branta~ L139~ Lickin~ 2019~ 30 38.1 -78.7 +## 2 mallar3 Mallard Anas p~ L139~ Lickin~ 2019~ 5 38.1 -78.7 +## 3 gnwtea Green-~ Anas c~ L139~ Lickin~ 2019~ 8 38.1 -78.7 +## 4 killde Killde~ Charad~ L139~ Lickin~ 2019~ 1 38.1 -78.7 +## 5 baleag Bald E~ Haliae~ L139~ Lickin~ 2019~ 1 38.1 -78.7 +## 6 belkin1 Belted~ Megace~ L139~ Lickin~ 2019~ 1 38.1 -78.7 +## 7 carwre Caroli~ Thryot~ L139~ Lickin~ 2019~ 1 38.1 -78.7 +## 8 whtspa White-~ Zonotr~ L139~ Lickin~ 2019~ 2 38.1 -78.7 +## 9 norcar Northe~ Cardin~ L139~ Lickin~ 2019~ 1 38.1 -78.7 +## 10 canvas Canvas~ Aythya~ L331~ Montic~ 2019~ 19 38.0 -78.5 +## # ... with 3 more variables: obsValid , obsReviewed , +## # locationPrivate +``` + +or set of hotspots + + +```r +ebirdhistorical(loc = 'L196159', date='2019-02-14', fieldSet='full') +``` + +``` +## # A tibble: 14 x 27 +## speciesCode comName sciName locId locName obsDt howMany lat lng +## +## 1 annhum Anna's~ Calypt~ L196~ Vancou~ 2019~ 4 49.3 -123. +## 2 ribgul Ring-b~ Larus ~ L196~ Vancou~ 2019~ 4 49.3 -123. +## 3 glwgul Glauco~ Larus ~ L196~ Vancou~ 2019~ 29 49.3 -123. +## 4 norcro Northw~ Corvus~ L196~ Vancou~ 2019~ 100 49.3 -123. +## 5 bkcchi Black-~ Poecil~ L196~ Vancou~ 2019~ 16 49.3 -123. +## 6 bushti Bushtit Psaltr~ L196~ Vancou~ 2019~ 20 49.3 -123. +## 7 pacwre1 Pacifi~ Troglo~ L196~ Vancou~ 2019~ 1 49.3 -123. +## 8 houfin House ~ Haemor~ L196~ Vancou~ 2019~ 2 49.3 -123. +## 9 purfin Purple~ Haemor~ L196~ Vancou~ 2019~ 3 49.3 -123. +## 10 amegfi Americ~ Spinus~ L196~ Vancou~ 2019~ 15 49.3 -123. +## 11 daejun Dark-e~ Junco ~ L196~ Vancou~ 2019~ 37 49.3 -123. +## 12 sonspa Song S~ Melosp~ L196~ Vancou~ 2019~ 12 49.3 -123. +## 13 spotow Spotte~ Pipilo~ L196~ Vancou~ 2019~ 1 49.3 -123. +## 14 rewbla Red-wi~ Agelai~ L196~ Vancou~ 2019~ 6 49.3 -123. +## # ... with 18 more variables: obsValid , obsReviewed , +## # locationPrivate , subnational2Code , subnational2Name , +## # subnational1Code , subnational1Name , countryCode , +## # countryName , userDisplayName , subId , obsId , +## # checklistId , presenceNoted , hasComments , +## # hasRichMedia , lastName , firstName +``` ### eBird taxonomy @@ -474,17 +526,17 @@ ebirdtaxonomy() ## # A tibble: 16,248 x 14 ## sciName comName speciesCode category taxonOrder bandingCodes ## -## 1 Struth… Common… ostric2 species 1 -## 2 Struth… Somali… ostric3 species 6 -## 3 Struth… Common… y00934 slash 7 -## 4 Rhea a… Greate… grerhe1 species 8 -## 5 Rhea p… Lesser… lesrhe2 species 14 -## 6 Rhea p… Lesser… lesrhe4 issf 15 -## 7 Rhea p… Lesser… lesrhe3 issf 18 -## 8 Nothoc… Tawny-… tabtin1 species 19 -## 9 Nothoc… Highla… higtin1 species 20 HITI -## 10 Nothoc… Highla… higtin2 issf 21 -## # … with 16,238 more rows, and 8 more variables: comNameCodes , +## 1 Struth~ Common~ ostric2 species 1 +## 2 Struth~ Somali~ ostric3 species 6 +## 3 Struth~ Common~ y00934 slash 7 +## 4 Rhea a~ Greate~ grerhe1 species 8 +## 5 Rhea p~ Lesser~ lesrhe2 species 14 +## 6 Rhea p~ Lesser~ lesrhe4 issf 15 +## 7 Rhea p~ Lesser~ lesrhe3 issf 18 +## 8 Nothoc~ Tawny-~ tabtin1 species 19 +## 9 Nothoc~ Highla~ higtin1 species 20 HITI +## 10 Nothoc~ Highla~ higtin2 issf 21 +## # ... with 16,238 more rows, and 8 more variables: comNameCodes , ## # sciNameCodes , order , familyComName , ## # familySciName , reportAs , extinct , extinctYear ``` @@ -500,17 +552,17 @@ ebirdtaxonomy(cat = "hybrid") ## # A tibble: 415 x 11 ## sciName comName speciesCode category taxonOrder bandingCodes ## -## 1 Dendro… Spotte… x00721 hybrid 219 -## 2 Dendro… Black-… x00775 hybrid 224 -## 3 Dendro… Black-… x00875 hybrid 226 -## 4 Anser … Snow x… sxrgoo1 hybrid 243 SRGH -## 5 Anser … Grayla… x00776 hybrid 251 -## 6 Anser … Bar-he… x00755 hybrid 259 -## 7 Anser … Snow x… x00627 hybrid 260 -## 8 Anser … Snow G… x00685 hybrid 280 -## 9 Anser … Pink-f… x00756 hybrid 282 -## 10 Anser … Greate… x00757 hybrid 283 -## # … with 405 more rows, and 5 more variables: comNameCodes , +## 1 Dendro~ Spotte~ x00721 hybrid 219 +## 2 Dendro~ Black-~ x00775 hybrid 224 +## 3 Dendro~ Black-~ x00875 hybrid 226 +## 4 Anser ~ Snow x~ sxrgoo1 hybrid 243 SRGH +## 5 Anser ~ Grayla~ x00776 hybrid 251 +## 6 Anser ~ Bar-he~ x00755 hybrid 259 +## 7 Anser ~ Snow x~ x00627 hybrid 260 +## 8 Anser ~ Snow G~ x00685 hybrid 280 +## 9 Anser ~ Pink-f~ x00756 hybrid 282 +## 10 Anser ~ Greate~ x00757 hybrid 283 +## # ... with 405 more rows, and 5 more variables: comNameCodes , ## # sciNameCodes , order , familyComName , ## # familySciName ``` @@ -539,8 +591,12 @@ ebirdregioninfo("L196159") ``` ``` -## # A tibble: 1 x 5 -## region minX maxX minY maxY -## -## 1 Vancouver--Trout Lake (John Hendry Park) -123. -123. 49.2 49.3 +## # A tibble: 1 x 16 +## locId name latitude longitude countryCode countryName subnational1Name +## +## 1 L196~ Vanc~ 49.3 -123. CA Canada British Columbia +## # ... with 9 more variables: subnational1Code , +## # subnational2Code , subnational2Name , isHotspot , +## # locName , lat , lng , hierarchicalName , +## # locID ```