Validate Catch Price
validate_price.Rd
Detects outliers in catch_price
by gear + catch_taxon
, assigning a
numeric alert code to records exceeding the computed upper bound. Outliers can be
replaced with NA
.
Arguments
- data
A data frame with
submission_id
,gear
,catch_taxon
, andcatch_price
.- k
A numeric parameter passed to
LocScaleB
, used inget_price_bounds
.- flag_value
A numeric code (default
6
) assigned to outlier prices.
Value
A data frame with columns:
submission_id
Carried from the input.
catch_taxon
Carried from the input.
catch_price
Potentially set to
NA
if outlier.alert_price
The numeric alert code, or
NA
.
Details
Calls
get_price_bounds
to compute outlier thresholds.Joins thresholds back to
data
viagear
andcatch_taxon
.Rowwise, flags prices above the
upper.up
bound withalert_price
, and replaces them withNA_real_
.
Examples
if (FALSE) { # \dontrun{
price_alert <- validate_price(data, k = 3, flag_value = 6)
head(price_alert)
} # }