R/logbook_operationobjet_observedsystem_control.R
logbook_operationobjet_observedsystem_control.RdThe purpose of the logbook_operationobjet_observedsystem_control function is to provide a table of data that contains a incoherent operation objet and the presence of observed system.
data.frame expected. Csv or output of the function data_extraction, which must be done before using the logbook_operationobjet_observedsystem_control.
data.frame expected. Csv or output of the function data_extraction, which must be done before using the logbook_operationobjet_observedsystem_control.
character expected. Kind of expected output. You can choose between "message", "report" or "logical".
character expected. Default values: c("1"). Vector containing the code for the operation on the object that must not have the observed system.
character expected. Default values: c("20"). Vector containing the code of the observed system that must not be linked to the object operation.
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 :
floatingobject_id
objectoperation_code
activity_id
Dataframe 2:
observedsystem_id
observedsystem_code
activity_id
#Floating object 1, 2 and 3 are ok,
#Floating object 4 has a conflict between the operation on the object and the observed system
#Floating object 5 has operation on the object missing
dataframe1 <- data.frame(floatingobject_id = c("1", "2", "3", "4", "5"),
objectoperation_code = c("1", "1", "2", "1", NA),
activity_id = c("1", "2", "3", "3", "4"))
dataframe2 <- data.frame(observedsystem_id = c("1", "2", "3"),
observedsystem_code = c("1", "2", "20"),
activity_id = c("1", "1", "3"))
logbook_operationobjet_observedsystem_control(dataframe1, dataframe2, output = "report")
#> floatingobject_id objectoperation_code logical count_observed_system
#> 1 1 1 TRUE 0
#> 2 2 1 TRUE 0
#> 3 3 2 TRUE 1
#> 4 4 1 FALSE 1
#> 5 5 <NA> FALSE 0