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

logbook_fishing_context_control(
  dataframe1,
  dataframe2,
  output,
  school_type_object = c("1"),
  school_type_free = c("2"),
  school_type_unknown = c("0")
)

Arguments

dataframe1

data.frame expected. Csv or output of the function data_extraction, which must be done before using the logbook_fishing_context_control () function.

dataframe2

data.frame expected. Csv or output of the function data_extraction, which must be done before using the logbook_fishing_context_control () function.

output

character expected. Kind of expected output. You can choose between "message", "report" or "logical".

school_type_object

character expected, default : c("1"). Vector of inventory of code of the object school.

school_type_free

character expected, default : c("2"). Vector of inventory of code of the free school.

school_type_unknown

character expected, default : c("0"). Vector of inventory of code of the unknown school.

Value

The function returns a character with output is "message", a data.frame with output is "report", a logical with output is "logical"

Details

The input dataframe must contain all these columns for the function to work :

  • activity_id

  • schooltype_code

  • observedsystem_id

  • activity_id

  • schooltype_code

Examples

#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