Compute haul-level swept-area estimates for a datras_raw / DATRASraw
object using one of the supported methods.
Usage
add_swept_area(
x,
method = "simple",
min_speed = 1,
min_dist = 0,
max_dist_dev = 0.2,
impute_missing = FALSE,
width = "WingSpread",
verbose = TRUE,
full_report = FALSE
)Arguments
- x
A
datras_rawobject.- method
Character string specifying the method used to calculate swept area. Must be either
"simple"(default) or"fishglob".- min_speed
Minimum plausible ground speed. Values below this threshold are treated as missing. Only used when
method = "simple". Defaults to1.- min_dist
Minimum plausible towing distance. Values below this threshold are treated as missing. Only used when
method = "simple". Defaults to0.- max_dist_dev
Maximum relative deviation allowed between recorded distance and distance reconstructed from
HaulDurandGroundSpeed. Distances with larger deviations are treated as missing. Only used whenmethod = "simple". Defaults to0.2.- impute_missing
Logical. Only used when
method = "simple". Defaults toFALSE.- width
Character string specifying which spread column to use as trawl width. Must be either
"WingSpread"(default) or"DoorSpread". Only used whenmethod = "simple"; ignored formethod = "fishglob".- verbose
Logical. If
TRUE(default) andmethod = "simple", print a summary of swept-area missingness and imputation by survey and gear.- full_report
Logical. If
TRUE, the printed and attached summary also includes per-column missingness counts (na_DoorSpread,na_WingSpread,na_Distance,na_HaulDur,na_GroundSpeed) for the original input columns. Only used whenmethod = "simple". Defaults toFALSE.
Details
This function is a wrapper around an internal simple swept-area function and
add_swept_area_fishglob(). It allows users to choose between a simple
rule-based approach and the FishGlob workflow.
If method = "simple", swept area is calculated using a simple rule-based
approach that applies basic plausibility filters, gear-specific median
imputations, and a direct distance-times-width calculation. A per-haul
logical column SweptArea_imputed is added to HH, and a survey-by-gear
summary of missingness and imputation is attached as
attr(x, "swept_area_summary") (and printed when verbose = TRUE).
If method = "fishglob", swept area is calculated using
add_swept_area_fishglob(), which follows the FishGlob workflow based on
survey-specific spread models and hierarchical fallback rules.
