Identifies in the observer data cases where the reason for discard is 99 or NA.

function_reason_for_discard_unknown_control(catch)

Arguments

catch

data.frame expected. All catches during the time range selected.

Value

The function returns one data.frame.

Details

The input dataframe must contain all these columns for the function to work :

  • catch_id

  • speciesfate_code

  • reasonfordiscard_code

Note

Version 1.0

Author

Chloé Tellier, Philippe S. Sabarros

Examples

#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