View source: R/algaebase_api_functions.R
extract_algaebase_field | R Documentation |
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.
extract_algaebase_field(query_result, field_name)
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. |
A character vector containing the values of the specified field, or NA
if the field is not found.
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.