The purpose of the logbook_sea_time_control function is to provide a table of data that contains an inconsistency between the sum of the sea times indicated for the route and the one indicated for the trip

logbook_sea_time_control(dataframe1, dataframe2, output)

Arguments

dataframe1

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

dataframe2

data.frame expected. Csv or output of the function data_extraction, which must be done before using the logbook_sea_time_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_seatime

  • route_id

  • trip_id

  • route_seatime

Examples

#Trip 1 is ok,
#Trip 2 has different sea times,
#Trip 3 has no trip_seatime,
#Trip 4 has no route_seatime,
#Trip 5 has trip_seatime = 0
dataframe1 <- data.frame(trip_id = c("1", "2", "3", "4", "5"),
                         trip_seatime = c(10, 15, NA, 8, 0))
dataframe2 <- data.frame(route_id = c("1", "2", "3", "4", "5", "6"),
                         trip_id = c("1", "1", "2", "2", "3", "5"),
                         route_seatime = c(4, 6, 10, 6, 5, 0))
logbook_sea_time_control(dataframe1, dataframe2, output = "report")
#>   trip_id logical trip_seatime sum_route_seatime
#> 1       1    TRUE           10                10
#> 2       2   FALSE           15                16
#> 3       3   FALSE           NA                 5
#> 4       4   FALSE            8                NA
#> 5       5   FALSE            0                 0