R/logbook_landing_total_weight_control.R
logbook_landing_total_weight_control.Rd
The purpose of the logbook_landing_total_weight_control function is to provide a table of data that contains an inconsistency between the sum of the weights of each landing for the canneries and the one indicated for the trip
logbook_landing_total_weight_control(
dataframe1,
dataframe2,
output,
epsilon = 0.01
)
data.frame expected. Csv or output of the function data_extraction, which must be done before using the logbook_landing_total_weight_control () function.
data.frame expected. Csv or output of the function data_extraction, which must be done before using the logbook_landing_total_weight_control () function.
character expected.Kind of expected output. You can choose between "message", "report" or "logical".
numeric expected, default : 0.01. Gives the threshold at which the difference is considered too large.
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 :
trip_id
trip_landingtotalweight
landing_id
landing_weight
trip_id
#Trip 1 and 4 are ok,
#Trip 2 has different landing weight,
#Trip 3 has no trip_landingtotalweight,
#Trip 5 has no landing_weight
dataframe1 <- data.frame(trip_id = c("1", "2", "3", "4", "5"),
trip_landingtotalweight = c(10, 15, NA, 0, 4))
dataframe2 <- data.frame(landing_id = c("1", "2", "3", "4", "5", "6"),
landing_weight = c(4, 6, 10, 6, 2, NA),
trip_id = c("1", "1", "2", "2", "3", "4"))
logbook_landing_total_weight_control(dataframe1, dataframe2, output = "report")
#> trip_id logical trip_landingtotalweight sum_weightlanding
#> 1 1 TRUE 10 10
#> 2 2 FALSE 15 16
#> 3 3 FALSE NA 2
#> 4 4 TRUE 0 NA
#> 5 5 FALSE 4 NA