extract_algaebase_field: Extract specific field from AlgaeBase query result

View source: R/algaebase_api_functions.R

extract_algaebase_fieldR Documentation

Extract specific field from AlgaeBase query result

Description

This helper function extracts a specified field from the list object returned by an AlgaeBase query. If the requested field is not present, it returns NA to indicate missing data.

Usage

extract_algaebase_field(query_result, field_name)

Arguments

query_result

A list object containing the output from an AlgaeBase query.

field_name

A character string specifying the field name to extract from the query result.

Value

A character vector containing the values of the specified field, or NA if the field is not found.

Examples

# Example output from an AlgaeBase query
query_result <- list(species = "Skeletonema marinoi", kingdom = "Chromista")
field_value <- SHARK4R:::extract_algaebase_field(query_result, "species")
print(field_value)


sharksmhi/SHARK4R documentation built on Jan. 9, 2025, 5:15 p.m.