R/function_reason_for_discard_unknown_control.R
function_reason_for_discard_unknown_control.RdIdentifies in the observer data cases where the reason for discard is 99 or NA.
function_reason_for_discard_unknown_control(catch)data.frame expected. All catches during the time range selected.
The function returns one data.frame.
The input dataframe must contain all these columns for the function to work :
catch_id
speciesfate_code
reasonfordiscard_code
Version 1.0
#Catch 1 is ok: the catch is not discarded,
#Catch 2 is ok: the catch is discarded and has a reason for discard,
#Catch 3 is not ok: the catch is discarded and has a reason for discard = NA,
#Catch 3 is not ok: the catch is discarded and does not have a reason for discard.
catch <- data.frame(catch_id = c("1", "2", "3", "4"),
speciesfate_code = c("6", "4", "5", "14"),
reasonfordiscard_code = c(NA, "1", NA, "99"))
function_reason_for_discard_unknown_control(catch)
#> catch_id speciesfate_code reasonfordiscard_code logical
#> 1 1 6 <NA> TRUE
#> 2 2 4 1 TRUE
#> 3 3 5 <NA> FALSE
#> 4 4 14 99 FALSE