R/logbook_fishing_context_control.R
logbook_fishing_context_control.Rd
The purpose of the logbook_fishing_context_control function is to provide a table of data that contains an inconsistency with school type and the association
data.frame expected. Csv or output of the function data_extraction, which must be done before using the logbook_fishing_context_control () function.
data.frame expected. Csv or output of the function data_extraction, which must be done before using the logbook_fishing_context_control () function.
character expected. Kind of expected output. You can choose between "message", "report" or "logical".
character expected, default : c("1"). Vector of inventory of code of the object school.
character expected, default : c("2"). Vector of inventory of code of the free school.
character expected, default : c("0"). Vector of inventory of code of the unknown school.
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
schooltype_code
observedsystem_id
activity_id
schooltype_code
#Activity 1, 2, 5, 6 and 7 are ok,
#Activity 3 has school type object,
#Activity 4 has no school type object
dataframe1 <- data.frame(activity_id = c("1", "2", "3", "4", "5", "6", "7"),
schooltype_code = c("2", "1", "2", "1", NA, "0", "2"))
dataframe2 <- data.frame(observedsystem_id = c("1", "2", "3", "4", "5"),
activity_id = c("1", "2", "2", "3", "4"),
schooltype_code = c("2", "2", "1", "1", "2"))
logbook_fishing_context_control(dataframe1, dataframe2, output = "report")
#> activity_id logical schooltype_code association_object_count
#> 1 1 TRUE 2 0
#> 2 2 TRUE 1 1
#> 3 3 FALSE 2 1
#> 4 4 FALSE 1 0
#> 5 5 TRUE <NA> 0
#> 6 6 TRUE 0 0
#> 7 7 TRUE 2 0