Skip to contents

Processes validated survey data to generate summary metrics and exports them to MongoDB collections. The function calculates three main types of metrics:

  1. Monthly CPUE and RPUE metrics by landing site

  2. Gear-specific metrics by landing site and habitat

  3. Taxa proportions by landing site

Usage

export_data(log_threshold = logger::DEBUG)

Arguments

log_threshold

The logging level threshold for the logger package (e.g., DEBUG, INFO) See logger::log_levels for available options.

Value

None (invisible). The function performs its operations for side effects:

  • Processes survey data into summary metrics

  • Uploads results to MongoDB collections

  • Generates logs of the process

Details

The function performs the following operations:

  • Filters out landing sites with >75% missing CPUE data

  • Calculates monthly median CPUE and RPUE values

  • Processes gear-specific metrics, excluding gears with spaces in names and "other" category

  • Computes taxa proportions, grouping taxa with <5% representation as "Others"

  • Uploads processed data to specified MongoDB collections

The metrics calculated include:

  • CPUE (Catch Per Unit Effort)

  • RPUE (Revenue Per Unit Effort)

  • Catch proportions by taxa

Exported collections:

  • Monthly metrics: Time series of CPUE and RPUE by landing site

  • Gear metrics: CPUE and RPUE by gear type, habitat, and landing site

  • Taxa proportions: Percentage contribution of each taxa to total catch by landing site

See also

Examples

if (FALSE) { # \dontrun{
# Export data with default debug logging
export_data()

# Export with info-level logging only
export_data(logger::INFO)
} # }