The purpose of the logbook_weight_control function is to provide a table of data that contains an inconsistency between the sum of the weight indicated for the catch and the one indicated for the activity

logbook_weight_control(dataframe1, dataframe2, output, epsilon = 0.01)

Arguments

dataframe1

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

dataframe2

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

output

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

epsilon

numeric expected, default : 0.01. Gives the threshold at which the difference is considered too large.

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 :

  • activity_id

  • activity_weight

  • catch_id

  • catch_weight

  • activity_id

Examples

#Activity 1, 2 and 4 are ok,
#Activity 3 has different weight
dataframe1 <- data.frame(activity_id = c("1", "2", "3", "4"),
                         activity_weight = c(10, 15.01, 6, NA))
dataframe2 <- data.frame(catch_id = c("1", "2", "3", "4", "5"),
                         catch_weight = c(10, 10, 5, 3, 2),
                         activity_id = c("1", "2", "2", "3", "3"))
logbook_weight_control(dataframe1, dataframe2, output = "report")
#>   activity_id logical activity_weight sum_catch_weight
#> 1           1    TRUE           10.00               10
#> 2           2    TRUE           15.01               15
#> 3           3   FALSE            6.00                5
#> 4           4    TRUE              NA               NA