R/logbook_fishing_time_control.R
logbook_fishing_time_control.Rd
The purpose of the logbook_fishing_time_control function is to provide a table of data that contains an inconsistency between the sum of the fishing times indicated for the route and the one indicated for the trip
logbook_fishing_time_control(dataframe1, dataframe2, output)
data.frame expected. Csv or output of the function data_extraction, which must be done before using the logbook_fishing_time_control () function.
data.frame expected. Csv or output of the function data_extraction, which must be done before using the logbook_fishing_time_control () function.
character expected.Kind of expected output. You can choose between "message", "report" or "logical".
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_fishingtime
route_id
trip_id
route_fishingtime
#Trip 1 and 5 are ok,
#Trip 2 has different fishing times,
#Trip 3 has no trip_fishingtime,
#Trip 4 has no route_fishingtime
dataframe1 <- data.frame(trip_id = c("1", "2", "3", "4", "5"),
trip_fishingtime = 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_fishingtime = c(4, 6, 10, 6, 14, 0))
logbook_fishing_time_control(dataframe1, dataframe2, output = "report")
#> trip_id logical trip_fishingtime sum_route_fishingtime
#> 1 1 TRUE 10 10
#> 2 2 FALSE 15 16
#> 3 3 FALSE NA 14
#> 4 4 FALSE 8 NA
#> 5 5 TRUE 0 0