Closed mjwestgate closed 2 years ago
search_taxa()
now returns a result with the same rank as the most specific rank provided by the user, and examples have been added to demonstrate how species may be identified using "specificEpithet" or "scientificName" in the search parameters.
Something that could be potentially done in future is to provide a more informative error message if the user tries to search for a species using the wrong parameters. For example:
search_taxa(tibble(species = "Pardalotus punctatus"))
No taxon matches were found for "Pardalotus punctatus".
# A tibble: 1 × 1
species
<chr>
1 Pardalotus punctatus
Ideally, the error message in this situation would indicate the wrong term has been used in the search i.e. "species" instead of "scientificName"
By default, we expect the user to pass a
string
, which typically resolves correctly, or else fails noisily when it doesn't:Whereas in this case, providing the same information in a
data.frame
resolves to a genus, not a species:Weirdly, even providing the full binomial species name doesn't work, if genus is also provided:
The desirable behaviour here would be for
search_taxa
to always return a result with the same rank as the most specific rank given by the user.