Learn R Programming

letsRept (version 1.1.0)

reptAdvancedSearch: 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 reptSpecies, 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

reptAdvancedSearch(
  higher = NULL,
  genus = NULL,
  year = NULL,
  common_name = NULL,
  synonym = NULL,
  location = NULL,
  verbose = TRUE,
  exact = FALSE
)

Value

A character string containing the URL to be used in reptSpecies.

If a provided synonym corresponds unambiguously to a valid species, the function also prints species information retrieved from RDB to the console.

Arguments

higher

Character string. A higher-level reptile taxon above genus (e.g., "snakes" or "Boidae").

genus

Character string. The current valid name of a reptile genus (e.g., "Apostolepis").

year

Character string. Filters the search by year of species description (e.g., "2025").

common_name

Character string. A common name potentially linked to a species or genus (e.g., "tree boa").

synonym

Character string. A name potentially regarded as a synonym of a valid taxon (e.g., "Boa diviniloqua").

location

Character string. A country or region name used to list species expected to occur there.

verbose

Logical. To be passed to reptSpecies() in the case of a provided synonym corresponds unambiguously to a valid species. If TRUE, prints status messages and species information in the console. Default is TRUE.

exact

Logical. To return outputs that matches exactly the searched term (e.g., avoid returning genus "Boaedon" when searching for "Boa"). Default is FALSE.

Examples

Run this code
# \donttest{
reptAdvancedSearch(higher = "snakes", year = "2010", location = "Brazil")
reptAdvancedSearch(year = "2010 OR 2011 OR 2012")
reptAdvancedSearch(genus = "Apostolepis OR \"Boa\" OR Atractus") #quotes "Boa"
# }

Run the code above in your browser using DataLab