Validate Catch Data
validate_catch.Rd
This function validates the catch data by comparing it to calculated upper bounds from the get_catch_bounds function. If a catch value exceeds the upper bound, an alert is triggered and the catch value is set to NA.
Value
A data frame with columns:
form_name
: The name of the form associated with the surveysurvey_id
: The unique identifier for each surveycatch_kg
: The original catch weight if valid, otherwise NAalert_catch
: A numeric value (4) indicating an outlier, or NA if the value is valid
Details
The function first calculates catch bounds using get_catch_bounds(). It then joins these bounds with the input data and compares each catch_kg value to its corresponding upper bound. If the catch_kg value is greater than or equal to the upper bound, an alert is set and the catch_kg value is changed to NA.