The purpose of the logbook_observed_system_floatting_object_pair_control function is to provide a table of data that contains a incoherent between the presence of floatting object and observed system for certain vessel activity.

logbook_observed_system_floatting_object_pair_control(
  dataframe1,
  dataframe2,
  dataframe3,
  output,
  vessel_activity = c("6"),
  observed_system = c("20")
)

Arguments

dataframe1

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

dataframe2

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

dataframe3

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

output

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

vessel_activity

character expected. Default values: c("6"). Vector containing the code for the vessel activity, which, if it contains a floating object, must also have an observer system (code observed_system) and vice versa.

observed_system

character expected. Default values: c("20"). Vector containing the code of the observed system that must be linked to the vessel activity

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 :

  • activity_id

  • vesselactivity_code

  • floatingobject_id

  • activity_id

  • observedsystem_id

  • observedsystem_code

  • activity_id

Examples

#Activity 1, 2, 3 and 4 are ok,
#Activity 5 has no observed system 20
#Activity 6 has observed system missing
#Activity 7 has floating object missing
#Activity 8 has vessel activity missing
dataframe1 <- data.frame(activity_id = c("1", "2", "3", "4", "5", "6", "7", "8"),
                         vesselactivity_code = c("6", "6", "1", "2", "6", "6", "6", NA))
dataframe2 <- data.frame(floatingobject_id = c("1", "2", "3", "4", "5"),
                         activity_id = c("1", "4", "5", "6", "8"))
dataframe3 <- data.frame(observedsystem_id = c("1", "2", "3", "4", "5", "6"),
                         observedsystem_code = c("20", "2", "20", "2", "20", "20"),
                         activity_id = c("1", "2", "3", "5", "7", "8"))
logbook_observed_system_floatting_object_pair_control(dataframe1,
                                                      dataframe2,
                                                      dataframe3,
                                                      output = "report")
#>   activity_id vesselactivity_code logical flotting_object observed_system
#> 1           1                   6    TRUE            TRUE            TRUE
#> 2           2                   6    TRUE           FALSE           FALSE
#> 3           3                   1    TRUE           FALSE            TRUE
#> 4           4                   2    TRUE            TRUE           FALSE
#> 5           5                   6   FALSE            TRUE           FALSE
#> 6           6                   6   FALSE            TRUE           FALSE
#> 7           7                   6   FALSE           FALSE            TRUE
#> 8           8                <NA>   FALSE            TRUE            TRUE