R/obs_catch_or_sample_outliers_control.R
obs_catch_or_sample_outliers_control.RdIdentifies for each species in the observer data the individuals with outliers lengths.
obs_catch_or_sample_outliers_control(data)data.frame expected. All catches or samples during the time range selected.
The function returns one data.frame.
The input dataframes must contain all these columns for the function to work :
catch_id
catch_meanlength
catch_meanlengthcomputedsource
species_minlength
species_maxlength
Or
samplemeasure_id
sample_length
sample_islengthcomputed
species_minlength
species_maxlength
Version 1.0
#Catch 1 is ok: the catch is 30 cm, its computed source is NA, its mean length is 10 and
# its max length is 60,
#Catch 2 is not ok: the catch is 12 cm, its computed source is NA, its mean length is 10 and
# its max length is 60,
#Catch 3 is not ok: the catch is 59 cm, its computed source is NA, its mean length is 10 and
# its max length is 60,
#Catch 4 is not ok: the catch is 30 cm, its computed source is NA, its mean length is NA and
# its max length is NA.
catch <- data.frame(catch_id = c("1", "2", "3", "4"),
catch_meanlength = c(30, 12, 59, 30),
catch_meanlengthcomputedsource = c(NA_integer_, NA_integer_, NA_integer_,
NA_integer_),
species_minlength = c(10, 10, 10, NA),
species_maxlength = c(60, 60, 60, NA))
obs_catch_or_sample_outliers_control(catch)
#> catch_id length species_minlength species_maxlength logical
#> 1 1 30 10 60 TRUE
#> 2 2 12 10 60 FALSE
#> 3 3 59 10 60 FALSE
#> 4 4 30 NA NA FALSE