Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation and tests to check for exoticCategory column #136

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading