R/logbook_sampleactivity_well_sampled_control.R
logbook_sampleactivity_well_sampled_control.RdThe purpose of the logbook_sampleactivity_well_sampled_control function is to provide a table of data that contains an inconsistency between the sampling activity and well sampled plan trip
logbook_sampleactivity_well_sampled_control(dataframe1, dataframe2, output)data.frame expected. Csv or output of the function data_extraction, which must be done before using the logbook_sampleactivity_well_sampled_control () function.
data.frame expected. Csv or output of the function data_extraction, which must be done before using the logbook_sampleactivity_well_sampled_control () function.
character expected. Kind of expected output. You can choose between "message", "report" or "logical".
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 :
wellactivity_id
well_label
activity_id
well_id
sampleactivity_id
sample_well
activity_id
#Well activity 1, 2 and 3 are ok,
#Well activity 4 is not linked to a sample, even though the well is sampled
dataframe1 <- data.frame(wellactivity_id = c("1", "2", "3", "4"),
well_label = c("well_1", "well_2", "well_3", "well_3"),
activity_id = c("1", "2", "3", "4"),
well_id = c("1", "2", "3", "3"))
dataframe2 <- data.frame(sampleactivity_id = c("1", "2"),
sample_well = c("well_1", "well_3"),
activity_id = c("1", "3"))
logbook_sampleactivity_well_sampled_control(dataframe1, dataframe2, output = "report")
#> # A tibble: 4 × 2
#> wellactivity_id logical
#> <chr> <lgl>
#> 1 1 TRUE
#> 2 2 TRUE
#> 3 3 TRUE
#> 4 4 FALSE