The purpose of the logbook_well_number_control function is to provide a table of data that contains an inconsistency between sample well number and associated trip well numbers

logbook_well_number_control(
  dataframe1,
  dataframe2,
  dataframe3,
  output,
  vessel_type = c("5", "6", "10")
)

Arguments

dataframe1

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

dataframe2

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

dataframe3

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

output

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

vessel_type

character expected. Default values: c("5", "6", "10"). Vector of codes for vessel types with a well plan.

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 :

  • sampleactivity_id

  • sample_well

  • activity_id

  • trip_id

  • wellactivity_id

  • well_label

  • activity_id

  • trip_id

  • vesseltype_code

Examples

#Sample activity 1, 2 and 3 are ok,
#Sample activity 4 has different well,
#Sample activity 5 has well missing in sample,
#Sample activity 6 has activity missing in well plan,
#Sample activity 7 has well missing in well plan
dataframe1 <- data.frame(sampleactivity_id = c("1", "2", "3", "4", "5", "6", "7"),
                         sample_well = c("well_1", "well_2", "well_5", "well_1",
                                         NA, "well_1", "well_2"),
                         activity_id = c("1", "1", "2", "3", "4", "5", "6"),
                         trip_id = c("1", "1", "2", "3", "3", "3", "3"))
dataframe2 <- data.frame(wellactivity_id = c("1", "2", "3", "4", "5"),
                         well_label = c("well_1", "well_2", "well_2", "well_2", NA),
                         activity_id = c("1", "1", "3", "4", "6"))
dataframe3 <- data.frame(trip_id = c("1", "2", "3"),
                         vesseltype_code = c("6", "1", "6"))
logbook_well_number_control(dataframe1, dataframe2, dataframe3, output = "report")
#>   sampleactivity_id logical sample_well
#> 1                 1    TRUE      well_1
#> 2                 2    TRUE      well_2
#> 3                 3    TRUE      well_5
#> 4                 4   FALSE      well_1
#> 5                 5   FALSE        <NA>
#> 6                 6   FALSE      well_1
#> 7                 7   FALSE      well_2