
Retrieve and Organize WoRMS Taxonomy for SHARK Aphia IDs
Source:R/worms_api_functions.R
add_worms_taxonomy.Rd
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.
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 ofaphia_id
. Defaults toNULL
, 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.
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)
} # }