Skip to contents

This function validates the n_boats column in the provided dataset using the alert_outlier function to detect outliers. If an outlier is detected, an alert is triggered and the n_boats value is set to NA.

Usage

validate_nboats(data = NULL, k = NULL)

Arguments

data

A data frame containing the n_boats column.

k

A numeric value used in the LocScaleB function for outlier detection.

Value

A data frame with three columns:

  • survey_id: The unique identifier for each survey

  • n_boats: The original number of boats if valid, otherwise NA

  • alert_n_boats: A numeric value (3) indicating an outlier, or NA if the value is valid