R/logbook_floating_object_part_when_leaving_control.R
logbook_floating_object_part_when_leaving_control.RdThe purpose of the logbook_floating_object_part_when_leaving_control function is to provide a table of data that contains a incoherent with the number of part of objects for floating object when arriving are greater than when leaving
logbook_floating_object_part_when_leaving_control(
dataframe1,
dataframe2,
output,
object_operation = c("8")
)data.frame expected. Csv or output of the function data_extraction, which must be done before using the logbook_floating_object_part_when_leaving_control.
data.frame expected. Csv or output of the function data_extraction, which must be done before using the logbook_floating_object_part_when_leaving_control.
character expected. Kind of expected output. You can choose between "message", "report" or "logical".
character expected. Default values: c("8"). Vector containing the codes for object operation with traditionally more items at the end than at the beginning
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
Dataframe 2:
floatingobjectpart_id
floatingobjectpart_whenarriving
floatingobjectpart_whenleaving
floatingobject_id
#Floating object 1, 2 and 3 is ok,
#Floating object 4 has no elements that have been added
#Floating object 5 does not include all of these elements that have been preserved
dataframe1 <- data.frame(floatingobject_id = c("1", "2", "3", "4", "5"),
objectoperation_code = c("1", "8", "8", "8", "8"))
dataframe2 <- data.frame(floatingobjectpart_id = c("1", "2", "3", "4", "5", "6", "7", "8"),
floatingobjectpart_whenarriving = c("true", NA, "false", "true", NA,
"true", "true", NA),
floatingobjectpart_whenleaving = c(NA, "true", "true", "true", "9",
"true", "false", "true"),
floatingobject_id = c("1", "2", "2", "3", "3", "4", "5", "5"))
logbook_floating_object_part_when_leaving_control(dataframe1, dataframe2, output = "report")
#> floatingobject_id objectoperation_code logical objet_part_additional_leaving
#> 1 1 1 TRUE FALSE
#> 2 2 8 TRUE TRUE
#> 3 3 8 TRUE TRUE
#> 4 4 8 FALSE FALSE
#> 5 5 8 FALSE TRUE
#> objet_part_retained_leaving
#> 1 FALSE
#> 2 TRUE
#> 3 TRUE
#> 4 TRUE
#> 5 FALSE