herpAdvancedSearch {letsHerp} | R Documentation |
Search The Reptile Database website (RDB): Advanced
Description
Creates a search URL for retrieving species lists from RDB based on multiple filters.
This URL is primarily used by herpSpecies
, but can also be used manually for advanced queries.
If a synonym is provided and can be unambiguously matched to a valid species, the function also prints detailed information for that species.
Usage
herpAdvancedSearch(higher=NULL,
genus=NULL,
year=NULL,
common_name=NULL,
synonym=NULL,
location=NULL)
Arguments
higher |
Character string. A higher-level reptile taxon above genus (e.g., |
genus |
Character string. The current valid name of a reptile genus (e.g., |
year |
Character string. Filters the search by year of species description (e.g., |
common_name |
Character string. A common name potentially linked to a species or genus (e.g., |
synonym |
Character string. A name potentially regarded as a synonym of a valid taxon (e.g., |
location |
Character string. A country or region name used to list species expected to occur there. |
Value
A character string containing the URL to be used in herpSpecies
.
If a provided synonym corresponds unambiguously to a valid species, the function also prints species information retrieved from RDB to the console.
Note
This function does not automatically quote input values. If you want to force an exact match (e.g., "Boa"
as a phrase),
you must manually include quotes in the input string, e.g., "\"Boa\""
.
Logical operators (e.g., OR
, AND
) are supported and will be properly formatted in the search.
To exclude terms, use a leading minus sign (e.g., higher = "-snakes"
) following RDB's query syntax, instead of using NOT
.
When a synonym is matched to a single valid species, the function will also display the species' full information as a side effect.
Examples
herpAdvancedSearch(higher = "snakes", year = "2010", location = "Brazil")
herpAdvancedSearch(year = "2010 OR 2011 OR 2012")
herpAdvancedSearch(genus = "Apostolepis OR \"Boa\" OR Atractus") #quotes "Boa"