R/logbook_vessel_activity_object_operation_control.R
logbook_vessel_activity_object_operation_control.RdThe purpose of the logbook_vessel_activity_object_operation_control function is to provide a table of data that contains a incoherent vessel activity and object operation for floating object.
data.frame expected. Csv or output of the function data_extraction, which must be done before using the logbook_vessel_activity_object_operation_control.
data.frame expected. Csv or output of the function data_extraction, which must be done before using the logbook_vessel_activity_object_operation_control.
character expected. Kind of expected output. You can choose between "message", "report" or "logical".
character expected. Default values: c("6"). Vector containing the vessel activity code that must not have a floating object with this object operation (operation_objet).
character expected. Default values: c("1"). Vector containing the code for the operation on the object that must not have this vessel activity (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
Dataframe 2:
floatingobject_id
objectoperation_code
activity_id
#Activity 1 and 2 are ok,
#Activity 3 has conflit between vessel activity and operation objet
#Activity 4 has vessel activity missing
#Activity 5 has operation objet missing
dataframe1 <- data.frame(activity_id = c("1", "2", "3", "4", "5"),
vesselactivity_code = c("6", "1", "6", NA, "6"))
dataframe2 <- data.frame(floatingobject_id = c("1", "2", "3", "4"),
objectoperation_code = c("2", "1", "1", NA),
activity_id = c("1", "2", "3", "5"))
logbook_vessel_activity_object_operation_control(dataframe1, dataframe2, output = "report")
#> activity_id vesselactivity_code logical
#> 1 1 6 TRUE
#> 2 2 1 TRUE
#> 3 3 6 FALSE
#> 4 4 <NA> FALSE
#> 5 5 6 FALSE