The purpose of the logbook_landing_control function is to provide a table of data that contains an inconsistency with the total landed weight greater than vessel capacity for the trip

logbook_landing_control(dataframe1, output)

Arguments

dataframe1

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

output

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

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 :

  • trip_id

  • trip_landingtotalweight

  • trip_localmarkettotalweight

  • vessel_capacity

Examples

#Trip 1 and 4 are ok,
#Trip 2 has a total weight greater than the vessel's capacity,
#Trip 3 has its vessel's capacity missing
dataframe1 <- data.frame(trip_id = c("1", "2", "3", "4"),
                         trip_landingtotalweight = c(10, 15, 2, NA),
                         trip_localmarkettotalweight = c(2, 1, 7, NA),
                         vessel_capacity = c(20, 10, NA, 13))
logbook_landing_control(dataframe1, output = "report")
#>   trip_id logical vessel_capacity trip_weighttotal
#> 1       1    TRUE            14.0               12
#> 2       2   FALSE             7.0               16
#> 3       3   FALSE              NA                9
#> 4       4    TRUE             9.1                0