R/logbook_observed_system_floatting_object_pair_control.R
logbook_observed_system_floatting_object_pair_control.RdThe 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.
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.
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.
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.
character expected. Kind of expected output. You can choose between "message", "report" or "logical".
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.
character expected. Default values: c("20"). Vector containing the code of the observed system that must be linked to the vessel activity
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 :
activity_id
vesselactivity_code
floatingobject_id
activity_id
observedsystem_id
observedsystem_code
activity_id
#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