Skip to contents

This function queries the Integrated Taxonomic Information System (ITIS) to find taxonomic details for a given species name. It can search using either a scientific name or a common name and return relevant taxonomic information, including the TSN.

Usage

mm_check_name(species_name, search_type, ask = FALSE)

Arguments

species_name

A character string specifying the species name to search for. Only a single name is allowed.

search_type

A character string specifying the type of search. Options:

  • "sientific_name": Search by scientific name.

  • "common_name": Search by common name.

ask

A logical value (TRUE or FALSE). If TRUE, allows interactive selection when multiple matches are found.

Value

A tibble containing taxonomic details:

  • search: The original species name queried.

  • tsn: The Taxonomic Serial Number (TSN) from ITIS.

  • common_name: The common name of the species (if available).

  • scientific_name: The scientific name of the species.

  • author: The author who classified the species.

  • itis_url: A direct link to the species report on ITIS.

  • taxon_status: The taxonomic status of the species.

Details

  • If the necessary packages (httr2, xml2) are not installed, the function prompts the user to install them.

  • If multiple results are found and ask = TRUE, the user is prompted to select the correct match.

  • If no exact match is found, all results are displayed for manual selection.

Examples

if (FALSE) { # \dontrun{
# Search for a species by scientific name
mm_check_name("Panthera leo", search_type = "sientific_name")

# Search by common name with interactive selection
mm_check_name("Lion", search_type = "common_name", ask = TRUE)
} # }