
Generate Catch-Level Validation Flags
get_catch_flags.RdThis function validates catch-level data from KEFS surveys and generates alert flags for inconsistencies in sample weights relative to total catch weights. It focuses on submissions where catch outcome was "yes" and checks for logical inconsistencies in the relationship between sample weights and total weights.
Arguments
- dat
A data frame containing KEFS survey catch data with columns:
submission_id: Unique identifier for the submission
catch_outcome: Whether catch was recorded ("yes" or "no")
total_sample_weight: Total weight of all samples in kilograms
total_catch_weight: Total weight of the entire catch in kilograms
sample_weight: Weight of individual sample in kilograms
sample_price: Price of the sample
Value
A data frame with columns:
submission_id: The original submission identifier
alert_flag_catch: Comma-separated string of alert codes (NA if no alerts):
"5.1": Total sample weight exceeds total catch weight
"5.2": Individual sample weight exceeds either total sample weight or total catch weight