Skip to contents

This function collects WoRMS (World Register of Marine Species) taxonomy information for a given set of Aphia IDs. The data is organized into a full taxonomic table that can be joined with data downloaded from SHARK.

Usage

add_worms_taxonomy(aphia_id, scientific_name = NULL, verbose = TRUE)

Arguments

aphia_id

A numeric vector containing Aphia IDs for which WoRMS taxonomy needs to be updated.

scientific_name

A character vector of scientific names. If provided, Aphia IDs will be retrieved from the scientific names. The length of scientific_name must match the length of aphia_id. Defaults to NULL, in which case the function will only add taxonomy to the provided Aphia IDs.

verbose

A logical indicating whether to print progress messages. Default is TRUE.

Value

A data frame containing current WoRMS taxonomy information.

Examples

if (FALSE) { # \dontrun{
# Update WoRMS taxonomy for a set of Aphia IDs
updated_taxonomy <- add_worms_taxonomy(c(149619, 149122, 11))
print(updated_taxonomy)

# Update WoRMS with an unknown Aphia ID and scientific names
with_names <- add_worms_taxonomy(c(149619, 149122, 11, NA),
                                 c("Cerataulina pelagica",
                                   "Chaetoceros didymus",
                                   "Ciliophora",
                                   "Dinophysis"))
print(with_names)
} # }