View source: R/algaebase_api_functions.R
match_algaebase | R Documentation |
This function queries the Algaebase API to retrieve taxonomic information for a list of algae names based on genus and (optionally) species. It supports exact matching, genus-only searches, and retrieval of higher taxonomic ranks.
match_algaebase(
genus,
species,
apikey = NULL,
genus_only = FALSE,
higher = TRUE,
unparsed = FALSE,
exact_matches_only = TRUE,
sleep_time = 1,
newest_only = TRUE,
verbose = TRUE
)
genus |
A character vector of genus names. |
species |
A character vector of species names corresponding to the |
apikey |
A character string containing the API key for accessing the Algaebase API. |
genus_only |
Logical. If |
higher |
Logical. If |
unparsed |
Logical. If |
exact_matches_only |
Logical. If |
sleep_time |
Numeric. The delay (in seconds) between consecutive Algaebase API queries. Defaults to |
newest_only |
A logical value indicating whether to return only the most recent entries (default is |
verbose |
Logical. If |
Scientific names can be parsed using the parse_scientific_names()
function before being processed by match_algaebase()
.
Duplicate genus-species combinations are handled efficiently by querying each unique combination only once. Genus-only searches are performed when genus_only = TRUE
or when the species name is missing or invalid. Errors during API queries are gracefully handled by returning rows with NA
values for missing or unavailable data.
The function allows for integration with data analysis workflows that require resolving or verifying taxonomic names against Algaebase.
A data frame containing taxonomic information for each input genus-species combination. Columns may include:
id
: Algaebase ID (if available)
kingdom
, phylum
, class
, order
, family
: Higher taxonomy (if higher = TRUE
)
genus
, species
, infrasp
: Genus, species, and infraspecies names (if applicable)
taxonomic_status
: Status of the name (e.g., "accepted", "synonym", "unverified")
currently_accepted
: Logical indicator for whether the name is currently accepted
accepted_name
: Currently accepted name if different from the input name
input_name
: Name supplied by the user
input_match
: 1
for exact matches, otherwise 0
taxon_rank
: Taxonomic rank of the accepted name (e.g., "genus", "species")
mod_date
: Date when the entry was last modified in Algaebase
long_name
: Full species name with authorship and date
authorship
: Authors associated with the species name
parse_scientific_names
## Not run:
# Example with genus and species vectors
genus_vec <- c("Thalassiosira", "Skeletonema", "Tripos")
species_vec <- c("pseudonana", "costatum", "furca")
algaebase_results <- match_algaebase(
genus = genus_vec,
species = species_vec,
apikey = "your_api_key",
exact_matches_only = TRUE,
verbose = TRUE
)
head(algaebase_results)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.