| Title: | Interface to the Reptile Database for Querying and Retrieving Taxonomic Data |
|---|---|
| Description: | Provides tools to search, access, and format taxonomic information from the Reptile Database (<http://reptile-database.org>) directly within R. Users can retrieve species-level data, distribution, etymology, synonyms, common names, and other relevant information for reptiles. Designed for taxonomists, ecologists, and biodiversity researchers. |
| Authors: | Paul Efren Santos Andrade [aut, cre] (ORCID: <https://orcid.org/0000-0002-6635-0375>) |
| Maintainer: | Paul Efren Santos Andrade <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.0.2 |
| Built: | 2026-05-16 05:20:38 UTC |
| Source: | https://github.com/PaulESantos/reptiledbr |
This function checks if there's a newer version of the reptiledb.data package available. It's automatically called when reptiledbr loads, but can also be called manually by users.
check_reptiledb_update(silent = FALSE)check_reptiledb_update(silent = FALSE)
silent |
Logical. If TRUE, suppresses messages and returns only the result object. Default is FALSE. |
Invisibly returns the update check result object from reptiledb.data::check_data_update(), or NULL if the package is not installed.
# Check for updates with user-friendly messages check_reptiledb_update() # Silent check for programmatic use result <- check_reptiledb_update(silent = TRUE) if (!is.null(result) && result$needs_update) { message("Update available!") }# Check for updates with user-friendly messages check_reptiledb_update() # Silent check for programmatic use result <- check_reptiledb_update(silent = TRUE) if (!is.null(result) && result$needs_update) { message("Update available!") }
extract_attribute(reptile_data, attribute_name, format_function = NULL)extract_attribute(reptile_data, attribute_name, format_function = NULL)
reptile_data |
A data frame obtained using the |
attribute_name |
Name of the attribute to extract (e.g., "Distribution", "Synonym"). |
format_function |
Optional formatting function for custom processing. |
Extracts and optionally formats structured information for a given attribute.
A tibble with formatted information for the specified attribute.
format_all_attributes(reptile_data, quiet = FALSE)format_all_attributes(reptile_data, quiet = FALSE)
reptile_data |
A data frame obtained using the |
quiet |
Logical. If TRUE, suppresses informational messages. Default is FALSE. |
Applies formatting functions to all known attributes in the reptile dataset.
A list containing all formatted attributes.
Format reptile comment data
Extracts and formats general comments associated with reptile species.
format_comments(reptile_data)format_comments(reptile_data)
reptile_data |
A data frame obtained using the |
A tibble containing formatted comments for each species.
Format common names for reptiles
format_common_names(reptile_data)format_common_names(reptile_data)
reptile_data |
A tibble returned by |
A tibble with formatted common names by species.
Format diagnostic information for reptiles
format_diagnosis(reptile_data)format_diagnosis(reptile_data)
reptile_data |
A tibble returned by |
A tibble with formatted diagnostic descriptions by species.
format_distribution(reptile_data)format_distribution(reptile_data)
reptile_data |
A tibble returned by |
A tibble with distribution data in long format.
Format etymological data of reptiles
Extracts and formats the etymological information associated with reptile species.
format_etymology(reptile_data)format_etymology(reptile_data)
reptile_data |
A data frame obtained using the |
A tibble containing the formatted etymological details for each species.
Format higher-level taxonomic data for reptiles
format_higher_taxa(reptile_data)format_higher_taxa(reptile_data)
reptile_data |
A tibble returned by |
A tibble with formatted higher taxonomic classification by species.
Format bibliographic reference data of reptiles
Extracts and formats bibliographic references associated with reptile species.
format_references(reptile_data)format_references(reptile_data)
reptile_data |
A data frame obtained using the |
A tibble containing formatted references for each species.
Format reproductive data for reptiles
format_reproduction(reptile_data)format_reproduction(reptile_data)
reptile_data |
A tibble returned by |
A tibble with formatted reproductive information by species.
format_selected_attributes(reptile_data, attributes, quiet = FALSE)format_selected_attributes(reptile_data, attributes, quiet = FALSE)
reptile_data |
A data frame obtained using the |
attributes |
A character vector specifying which attributes to extract. |
quiet |
Logical. If TRUE, suppresses informational messages. Default is FALSE. |
Extracts and formats only the specified attributes from the reptile dataset.
A list containing the selected formatted attributes.
Format subspecies data for reptiles
format_subspecies(reptile_data)format_subspecies(reptile_data)
reptile_data |
A tibble returned by |
A tibble with formatted subspecies by species.
format_synonyms(reptile_data)format_synonyms(reptile_data)
reptile_data |
A tibble returned by |
A tibble with formatted synonym names by species.
Format nomenclatural type data for reptiles
format_types(reptile_data)format_types(reptile_data)
reptile_data |
A tibble returned by |
A tibble with formatted type information by species.
Retrieves taxonomic information on living reptile species from The Reptile Database. This function allows users to explore scientific names, synonyms, distributions, and taxonomic references for all known species of snakes, lizards, turtles, amphisbaenians, tuataras, and crocodiles.
get_reptiledb_data(species_names, timeout = 10, quiet = FALSE)get_reptiledb_data(species_names, timeout = 10, quiet = FALSE)
species_names |
A character string with the scientific name of the species (e.g., "Crocodylus acutus"). |
timeout |
Maximum waiting time for each request (in seconds) |
quiet |
Logical value TRUE or FALSE. |
The Reptile Database currently includes more than 10,000 species and around 2,800 subspecies. It focuses on taxonomic and nomenclatural data, including valid names, synonyms, type localities, distribution, and original references. However, ecological and behavioral data are largely absent.
Data are compiled from peer-reviewed literature, expert contributions, and curated by an editorial team. Updates and corrections from users are welcome and help improve the resource.
The classification follows recent phylogenetic studies (e.g., Zheng & Wiens, 2016), although the database takes a conservative approach to rapidly changing taxonomic hypotheses. New genera or species proposals may first appear in the "synonyms" field pending wider scientific acceptance.
Note: The database does not support species identification by traits, but users can search by geographical distribution and higher taxonomic groups.
A list or data frame containing available taxonomic information (e.g., accepted name, synonyms, family, distribution, literature references).
Data curated by P. Uetz and collaborators. Function implementation by Paul E. Santos Andrade.
Uetz, P., Freed, P., & Hosek, J. (eds.) (2021). The Reptile Database. Available at: https://reptile-database.reptarium.cz
For more on phylogenetic background see: Zheng, Y., & Wiens, J. J. (2016). Combining phylogenomics and fossils in higher-level squamate reptile phylogeny. BMC Evolutionary Biology, 16, 1-20.
https://reptile-database.reptarium.cz
get_reptiledb_data("Anolis carolinensis", quiet = TRUE)get_reptiledb_data("Anolis carolinensis", quiet = TRUE)
This function processes results from a ReptileDB database search to extract subspecies information. It identifies species that have subspecies and returns a tibble with the species name, subspecies name, and author information.
list_subspecies_reptiledbr(df)list_subspecies_reptiledbr(df)
df |
A dataframe or tibble result from using reptiledbr_exact, reptiledbr_partial or search_reptiledbr functions. |
A tibble with three columns:
species |
The name of the species |
subspecies_name |
The full name of the subspecies |
author |
The author and year of the subspecies description |
## Not run: # These examples require the 'reptiledb.data' package to be installed. subspecies_names <- c("Lachesis muta", "Anilius scytale", "Anolis bahorucoensis") search_reptiledbr(subspecies_names, use_fuzzy = FALSE) |> list_subspecies_reptiledbr() ## End(Not run)## Not run: # These examples require the 'reptiledb.data' package to be installed. subspecies_names <- c("Lachesis muta", "Anilius scytale", "Anolis bahorucoensis") search_reptiledbr(subspecies_names, use_fuzzy = FALSE) |> list_subspecies_reptiledbr() ## End(Not run)
This function searches for exact matches of scientific species names and indicates whether each matched species has associated subspecies in the dataset.
reptiledbr_exact(species_names)reptiledbr_exact(species_names)
species_names |
Character vector of full species names to search for. |
A tibble with taxonomic information and a message indicating subspecies presence.
The response variable may return different messages depending on the outcome of the query. Possible values include:
"Species not found" – The specified species could not be matched in the database.
"Species has subspecies" – The specified species exists and has one or more subspecies registered.
"No subspecies found" – The species was found, but there are no subspecies associated with it in the database.
## Not run: # These examples require the 'reptiledb.data' package to be installed. # You can install it from its source if not on CRAN. reptiledbr_exact(c("Ablepharus alaicus", "Anolis limon")) ## End(Not run)## Not run: # These examples require the 'reptiledb.data' package to be installed. # You can install it from its source if not on CRAN. reptiledbr_exact(c("Ablepharus alaicus", "Anolis limon")) ## End(Not run)
This function performs approximate (fuzzy) matching of species names from a given list of input terms against the species names in the reptile database, and indicates whether each matched species has subspecies.
reptiledbr_partial(species_names, max_dist = 2)reptiledbr_partial(species_names, max_dist = 2)
species_names |
Character vector. One or more scientific names or fragments to match approximately. |
max_dist |
Maximum string distance allowed for a match (default: 2). |
A tibble with matched species, taxonomic info, fuzzy match flag, and subspecies presence. The response variable may return different messages depending on the outcome of the query. Possible values include:
"Species not found" – The specified species could not be matched in the database.
"Species has subspecies" – The specified species exists and has one or more subspecies registered.
"No subspecies found" – The species was found, but there are no subspecies associated with it in the database.
## Not run: # These examples require the 'reptiledb.data' package to be installed. reptiledbr_partial(c("Ablepharus alaicuss", "Anolis limom")) ## End(Not run)## Not run: # These examples require the 'reptiledb.data' package to be installed. reptiledbr_partial(c("Ablepharus alaicuss", "Anolis limom")) ## End(Not run)
This function combines both exact and fuzzy matching approaches to search for reptile species names in the database. It first attempts exact matches and then uses fuzzy matching for any species names that weren't found exactly.
search_reptiledbr(species_names, max_dist = 2, use_fuzzy = TRUE)search_reptiledbr(species_names, max_dist = 2, use_fuzzy = TRUE)
species_names |
Character vector of scientific species names to search for. |
max_dist |
Maximum string distance allowed for fuzzy matching (default: 2). |
use_fuzzy |
Logical. If TRUE, performs fuzzy search for species not found exactly. If FALSE, only does exact matching (default: TRUE). |
A combined tibble with results from both exact and fuzzy matching approaches, with a flag indicating the match type. Results maintain the original order of species_names. The response variable may return different messages depending on the outcome of the query. Possible values include:
"Species not found" – The specified species could not be matched in the database.
"Species has subspecies" – The specified species exists and has one or more subspecies registered.
"No subspecies found" – The species was found, but there are no subspecies associated with it in the database.
## Not run: # These examples require the 'reptiledb.data' package to be installed. search_reptiledbr(c("Ablepharus alaicus", "Anolis limom")) ## End(Not run)## Not run: # These examples require the 'reptiledb.data' package to be installed. search_reptiledbr(c("Ablepharus alaicus", "Anolis limom")) ## End(Not run)