Skip to contents

This function processes length data to identify outliers in total length using the LocScaleB method with the MAD method for outlier detection. The k parameter is used to determine the extension of bounds. The function selects and transforms data, groups it by gear type and species, and applies the outlier detection using the specified k_max_length threshold.

Usage

validate_length(data = NULL, k_max_length = NULL)

Arguments

data

A data frame containing length information, including columns _id, gear_type, and length.

k_max_length

Nonnegative constant used in the MAD method for determining bounds in outlier detection for total length. Common values are 2, 2.5, and 3.

Value

A data frame with the original length data, additional columns for detected outliers, and nested length data.

Examples

if (FALSE) { # \dontrun{
# Assuming you have a data frame `length_data` with the necessary structure:
validated_length <- validate_length(data = length_data, k_max_length = 200)
} # }