Skip to contents

Main pipeline function that downloads the taxa metadata from cloud storage, expands each record to matching FishBase / SeaLifeBase species (filtered to FAO Area 57 — Western Indian Ocean), and joins biological attributes including vulnerability, trophic level, feeding guild, and nutrient composition. The final dataset is uploaded as a versioned Parquet file to the project cloud bucket.

Usage

enrich_taxa(log_threshold = logger::DEBUG)

Arguments

log_threshold

Logging threshold passed to [logger::log_threshold()]. Defaults to [logger::DEBUG].

Value

Invisible NULL. Called for its side effect of uploading the enriched taxa Parquet file to cloud storage.

Details

The function performs the following steps: 1. Downloads the latest metadata RDS file (Airtable assets) from GCS. 2. Extracts the `taxa` table and calls [expand_taxonomic_info()]. 3. Filters species to FAO Area 57 (or those without an area assignment). 4. Joins species-level data from the `species`, `ecology`, and `estimate` tables. 5. Deduplicates by taking the first non-`NA` value per group. 6. Cleans column names with [janitor::clean_names()]. 7. Uploads the result via [upload_parquet_to_cloud()] using the `metadata.fishbase.taxa_enriched.file_prefix` configuration key.

Examples

if (FALSE) { # \dontrun{
coasts::enrich_taxa()
} # }