The purpose of the logbook_length_class_control function is to provide a table of data that contains an inconsistency between the size class of the samples depending on the species and measurement type and the valid threshold (Default : 80)

logbook_length_class_control(
  dataframe1,
  output,
  species = c("YFT", "BET", "ALB"),
  size_measure_type = "FL",
  threshold = 80
)

Arguments

dataframe1

data.frame expected. Csv or output of the function data_extraction, which must be done before using the logbook_length_class_control () function.

output

character expected. Kind of expected output. You can choose between "message", "report" or "logical".

species

character expected. Default values: c("YFT", "BET", "ALB"). Vector of the species inventory controlled.

size_measure_type

character expected. Default values: "FL". Vector of the size measure type controlled.

threshold

numeric expected. Default values: 80. Maximum size threshold measured

Value

The function returns a character with output is "message", a data.frame with output is "report", a logical with output is "logical"

Details

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

  • samplespeciesmeasure_id

  • species_fao_code

  • sizemeasuretype_code

  • samplespeciesmeasure_sizeclass

Examples

#Activity 1, 2 and 3 are ok,
#Activity 4 has size class is greater than threshold,
#Activity 5 has size class is missing
dataframe1 <- data.frame(samplespeciesmeasure_id = c("1", "2", "3", "4", "5"),
                         species_fao_code = c("YFT", "YFT", "LTA", "YFT", "YFT"),
                         sizemeasuretype_code = c("FL", "PD1", "FL", "FL", "FL"),
                         samplespeciesmeasure_sizeclass = c(10, 90, 85, 83, NA))
logbook_length_class_control(dataframe1, output = "report")
#>   samplespeciesmeasure_id logical samplespeciesmeasure_sizeclass
#> 1                       1    TRUE                             10
#> 2                       2    TRUE                             90
#> 3                       3    TRUE                             85
#> 4                       4   FALSE                             83
#> 5                       5   FALSE                             NA