fetch_classification_from_worms: Fetches taxonomic classification for a given AphiaID from...

View source: R/check_classification.R

fetch_classification_from_wormsR Documentation

Fetches taxonomic classification for a given AphiaID from WoRMS This function queries the WoRMS API to retrieve taxonomic classification information for a specified AphiaID. If the AphiaID is NA or the fetch fails, it returns NULL with a warning. The function handles HTTP response errors by warning the user and returns the classification as a list if successful.

Description

Fetches taxonomic classification for a given AphiaID from WoRMS This function queries the WoRMS API to retrieve taxonomic classification information for a specified AphiaID. If the AphiaID is NA or the fetch fails, it returns NULL with a warning. The function handles HTTP response errors by warning the user and returns the classification as a list if successful.

Usage

fetch_classification_from_worms(aphia_id)

Arguments

aphia_id

An integer representing the AphiaID for which to fetch the classification.

Value

Returns a list containing the taxonomic levels (Kingdom, Phylum, Class, Order, Family, Genus, Species) of the classification if successful. Returns NULL if the fetch is unsuccessful or if the AphiaID is NA.


BLE-LTER/BLE-LTER-utils documentation built on Jan. 5, 2025, 5:38 p.m.