-
Notifications
You must be signed in to change notification settings - Fork 17
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
ebirdregion()
output sometimes includes exoticCategory
field
#129
Comments
Which do you think is a better approach @sebpardo?
1 sticks closer to what the API actually returns, but 2 produces more consistent results. I probably favor number 1, which is what I'm pretty sure is what you were proposing along with adding |
I also prefer approach 1. I think it's relatively easy to fix tests to accommodate returns of different numbers of columns, and add something along these lines to the documentation of those functions: #' @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{https://ebird.org/news/important-changes-to-exotic-species-in-ebird}. EDIT: This other url might be better?: https://support.ebird.org/en/support/solutions/articles/48001218430 As a side note, here's a checklist with all four categories, I hope there aren't more: library(rebird)
library(dplyr)
ebirdchecklist("S165343164") |>
mutate(name = tax[which(tax$speciesCode %in% speciesCode), "comName"]) |>
select(name, exoticCategory)
#> # A tibble: 6 × 2
#> name$comName exoticCategory
#> <chr> <chr>
#> 1 Red-crowned Parrot N
#> 2 Lilac-crowned Parrot P
#> 3 Red-lored Parrot P
#> 4 Yellow-headed Parrot X
#> 5 Green Parakeet N
#> 6 Chihuahuan Raven <NA> |
I think these are the functions that can (sometimes?) return
The column |
I noticed that sometimes the test for this function fails due to a mismatch between the expected and returned number of columns. What's happening if that if the query includes exotic species, then an additional field named
exoticCategory
is being returned. This might not be behaviour exclusive toebirdregion()
.Need to include this field in the documentation for this function, update tests, and perhaps have a quick look around to see if any other functions are also showing this behaviour.
The text was updated successfully, but these errors were encountered: