This function validates the n_boats
column in the provided dataset.
An alert (error label) is triggered if the number of boats is an outlier,
determined by the alert_outlier
function with specified parameters. The alert number
is stored in alert_n_boats
. If an alert is triggered, 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 two columns: n_boats
and alert_n_boats
.
n_boats
: The original number of boats if valid, otherwise NA
.
alert_n_boats
: A numeric value indicating the alert (error label) number.
Examples
if (FALSE) { # \dontrun{
validate_nboats(data, k = 2)
} # }