The purpose of the logbook_weighting_sample_control function is to provide a table of data that contains an inconsistency between the sample weighting and weight in well

logbook_weighting_sample_control(
  dataframe1,
  dataframe2,
  output,
  species = c("YFT", "SKJ", "BET", "ALB", "LTA", "FRI", "TUN", "KAW", "LOT"),
  epsilon = 0.01
)

Arguments

dataframe1

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

dataframe2

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

output

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

species

character expected. Default values: c("YFT", "SKJ", "BET", "ALB", "LTA", "FRI", "TUN", "KAW", "LOT"). list of the inventory of species (FAO code) used to compare to sample weighting.

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 :

  • sampleactivity_id

  • sampleactivity_weightedweight

  • sample_well

  • activity_id

  • wellactivityspecies_id

  • wellactivityspecies_weight

  • species_fao_code

  • well_label

  • activity_id

Examples

#Sample activity 1, 2, 3, 4 and 5 are ok,
#Sample Activity 6 has weights missing from the well,
#Sample Activity 7 does not take into account all species
#Sample Activity 8 does not take into account all well
#Sample Activity 9 has weighted weight missing
dataframe1 <- data.frame(sampleactivity_id = c("1", "2", "3", "4", "5", "6", "7", "8", "9"),
                         sampleactivity_weightedweight = c(3, 6, 20, 6.25, 13.75, 2, 26, 13, NA),
                         sample_well = c("well_1", "well_2", "well_1", "well_1", "well_2",
                                         "well_1", "well_1", "well_1", "well_1"),
                         activity_id = c("1", "1", "2", "3", "3", "4", "5", "6", "7"))
dataframe2 <- data.frame(wellactivityspecies_id = c("1", "2", "3", "4", "5", "6", "7", "8", "9",
                                                    "10", "11", "12", "13"),
                         wellactivityspecies_weight = c(3, 2, 4, 1, 15, 5, 5, 11, 4, 26, 2, 13, 6),
                         species_fao_code = c("YFT", "SKJ", "ALB", "JOS", "YFT", "FRI", "YFT",
                                              "SKJ", "BET", "ALB", "YFT", "BET", "ALB"),
                         well_label = c("well_1", "well_2", "well_2", "well_2", "well_1", "well_2",
                                        "well_1", "well_2", "well_3", "well_1", "well_1", "well_1",
                                        "well_2"),
                         activity_id = c("1", "1", "1", "1", "2", "2", "3", "3", "3", "5", "5", "6",
                                         "6"))
logbook_weighting_sample_control(dataframe1, dataframe2, output = "report")
#>   sampleactivity_id sampleactivity_weightedweight logical weightedweight_well
#> 1                 1                          3.00    TRUE                3.00
#> 2                 2                          6.00    TRUE                6.00
#> 3                 3                         20.00    TRUE               20.00
#> 4                 4                          6.25    TRUE                6.25
#> 5                 5                         13.75    TRUE               13.75
#> 6                 6                          2.00   FALSE                  NA
#> 7                 7                         26.00   FALSE               28.00
#> 8                 8                         13.00   FALSE               19.00
#> 9                 9                            NA   FALSE                  NA