R/logbook_length_class_control.R
logbook_length_class_control.RdThe 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)
data.frame expected. Csv or output of the function data_extraction, which must be done before using the logbook_length_class_control () function.
character expected. Kind of expected output. You can choose between "message", "report" or "logical".
character expected. Default values: c("FL", "PD1"). Vector of the size measure type controlled.
numeric expected. Default values: 10 and 80. Vector containing the lower and upper acceptable threshold for the size measured
The function returns a character with output is "message", a data.frame with output is "report", a logical with output is "logical"
The input dataframe must contain all these columns for the function to work :
samplespeciesmeasure_id
sizemeasuretype_code
samplespeciesmeasure_sizeclass
#Activity 1 and 2 are ok,
#Activity 3 has size class is less than threshold,
#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"),
sizemeasuretype_code = c("FL", "PD1", "PD1", "FL", "FL"),
samplespeciesmeasure_sizeclass = c(25, 75, 5, 83, NA))
logbook_length_class_control(dataframe1, output = "report")
#> samplespeciesmeasure_id logical samplespeciesmeasure_sizeclass
#> 1 1 TRUE 25
#> 2 2 TRUE 75
#> 3 3 FALSE 5
#> 4 4 FALSE 83
#> 5 5 FALSE NA