ct_check_name: Check species name and retrieve Taxonomic Serial Number (TSN)...

View source: R/ct_check_name.R

ct_check_nameR Documentation

Check species name and retrieve Taxonomic Serial Number (TSN) from ITIS

Description

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

ct_check_name(
  species_name,
  search_type = c("common_name", "scientific_name"),
  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:

  • "scientific_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.

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.

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.

See Also

https://www.itis.gov/

Examples


# Search for a species by scientific name
ct_check_name("Panthera leo", search_type = "scientific_name")

# Search by common name with interactive selection
ct_check_name("Lion", search_type = "common_name")




ct documentation built on Oct. 22, 2026, 1:07 a.m.