Skip to content

Commit

Permalink
Merge pull request #136 from RichardLitt/feat/129-exotics
Browse files Browse the repository at this point in the history
Add documentation and tests to check for exoticCategory column
  • Loading branch information
sebpardo authored Feb 5, 2025
2 parents 16be6f2 + aba9865 commit 32abacc
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 3 deletions.
5 changes: 4 additions & 1 deletion R/ebirdchecklist.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@
#' @return "speciesCode" species codes reported on checklist
#' @return "obsId" observation IDs for each taxon on checklist
#' @return "howManyStr" number of individuals reported for each taxon
#' @return "exoticCategory" exotic species categories for each taxon
#' @return "exoticCategory": If applicable, exotic species category. This column will be provided
#' if there are exotics or introduced species in the query. Return values are "N" for naturalized,
#' "P" for provisional, "X" for escapee, and NA for native. For more information see
#' \url{support.ebird.org/en/support/solutions/articles/48001218430}.
#' @return "obsComments" observation comments for each taxon
#' @return "photoCounts" number of photos for each taxon
#' @return "audioCounts" number of audio files for each taxon
Expand Down
4 changes: 4 additions & 0 deletions R/ebirdgeo.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@
#' @return "obsValid": TRUE if observation has been deemed valid by either the
#' automatic filters or a regional viewer, FALSE otherwise
#' @return "sciName" species' scientific name
#' @return "exoticCategory": If applicable, exotic species category. This column will be provided
#' if there are exotics or introduced species in the query. Return values are "N" for naturalized,
#' "P" for provisional, "X" for escapee, and NA for native. For more information see
#' \url{support.ebird.org/en/support/solutions/articles/48001218430}.
#' @export
#' @examples \dontrun{
#' ebirdgeo('amegfi', 42, -76) # American Goldfinch
Expand Down
5 changes: 4 additions & 1 deletion R/ebirdhistorical.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@
#' @return "obsReviewed": TRUE if observation has been reviewed, FALSE otherwise
#' @return "locationPrivate": TRUE if location is not a birding hotspot
#' @return "subID": submission ID
#' @return "exoticCategory": exotic species category
#' @return "exoticCategory": If applicable, exotic species category. This column will be provided
#' if there are exotics or introduced species in the query. Return values are "N" for naturalized,
#' "P" for provisional, "X" for escapee, and NA for native. For more information see
#' \url{support.ebird.org/en/support/solutions/articles/48001218430}.
#' @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)
Expand Down
5 changes: 4 additions & 1 deletion R/ebirdnotable.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@
#' @return "locationPrivate": TRUE if location is not a birding hotspot
#' automatic filters or a regional viewer, FALSE otherwise
#' @return "subId": submission ID
#' @return "exoticCategory": Exotic category
#' @return "exoticCategory": If applicable, exotic species category. This column will be provided
#' if there are exotics or introduced species in the query. Return values are "N" for naturalized,
#' "P" for provisional, "X" for escapee, and NA for native. For more information see
#' \url{support.ebird.org/en/support/solutions/articles/48001218430}.
#' @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)
Expand Down
4 changes: 4 additions & 0 deletions R/ebirdregion.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@
#' @return "obsReviewed": TRUE if observation has been reviewed, FALSE otherwise
#' @return "locationPrivate": TRUE if location is not a birding hotspot
#' @return "subId": submission ID
#' @return "exoticCategory": If applicable, exotic species category. This column will be provided
#' if there are exotics or introduced species in the query. Return values are "N" for naturalized,
#' "P" for provisional, "X" for escapee, and NA for native. For more information see
#' \url{support.ebird.org/en/support/solutions/articles/48001218430}.
#' @export
#' @examples \dontrun{
#' ebirdregion(loc = 'US', species = 'btbwar')
Expand Down
4 changes: 4 additions & 0 deletions R/nearestobs.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@
#' @return "obsReviewed": TRUE if observation has been reviewed, FALSE otherwise
#' @return "locationPrivate": TRUE if location is not a birding hotspot
#' @return "subId": submission ID
#' @return "exoticCategory": If applicable, exotic species category. This column will be provided
#' if there are exotics or introduced species in the query. Return values are "N" for naturalized,
#' "P" for provisional, "X" for escapee, and NA for native. For more information see
#' \url{support.ebird.org/en/support/solutions/articles/48001218430}.
#' @export
#'
#' @author Rafael Maia \email{rm72@@zips.uakron.edu},
Expand Down
5 changes: 5 additions & 0 deletions tests/testthat/test-ebirdchecklist.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ vcr::use_cassette("ebirdchecklist", {
expect_true('audioCounts' %in% colnames(out2))
expect_equal(nrow(out2), 2)

# Returns exoticCategory or doesn't, depending on whether it is in the checklist
expect_true('exoticCategory' %in% colnames(out1))
expect_false('exoticCategory' %in% colnames(out2))


})

test_that("ebirdchecklist errors for bad input", {
Expand Down

0 comments on commit 32abacc

Please sign in to comment.