Get Catch Bounds by Gear + Taxon
get_catch_bounds_taxon.RdComputes upper/lower outlier bounds for catch data (catch_kg) grouped by
the interaction of gear and catch_taxon. This function uses
LocScaleB with a (default) log transform to find outlier
thresholds for each gear-taxont group, then exponentiates the upper bound.
Arguments
- data
A data frame that includes the columns
gear,catch_taxon, andcatch_kg.- k
A numeric parameter passed to
LocScaleB, controlling how "wide" the outlier threshold will be (oftenk = 3ork = 2).
Value
A data frame with columns gear, catch_taxon, upper.up,
and the bounds from LocScaleB. The lower.low column is dropped.
Details
Filters to columns
gear,catch_taxon, andcatch_kg.Splits the data by the interaction of
gearandcatch_taxon.Runs
LocScaleBon each subset (withlogt = TRUE), retrieving thebounds.Binds the subset results, exponentiates the
upper.upbound, then separatesgear_taxonback intogearandcatch_taxon.
See also
LocScaleB for outlier detection,
validate_catch_taxa for usage of these bounds in a validation step.
Examples
if (FALSE) { # \dontrun{
data_bounds <- get_catch_bounds_taxon(data, k = 3)
head(data_bounds)
} # }