The purpose of the logbook_measure_control function is to provide a table of data that contains an inconsistency between the total number of individuals measured per sample and the sum of individuals per sample, species and size class

logbook_measure_control(dataframe1, dataframe2, output)

Arguments

dataframe1

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

dataframe2

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

output

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

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 :

  • samplespecies_id

  • samplespecies_measuredcount

  • sample_id

  • samplespeciesmeasure_id

  • samplespeciesmeasure_count

  • samplespecies_id

Examples

#Sample 1 and 2 are ok,
#Sample 3 has different count,
#Sample 4 has sample species measure count is missing in dataframe2,
#Sample 5 has sample species measured count is missing in dataframe1
dataframe1 <- data.frame(samplespecies_id = c("1", "2", "3", "4", "5", "6"),
                         samplespecies_measuredcount = c(4, 6, 15, 6, 7, NA),
                         sample_id = c("1", "1", "2", "3", "4", "5"))
dataframe2 <- data.frame(samplespeciesmeasure_id = c("1", "2", "3", "4", "5", "6"),
                         samplespeciesmeasure_count = c(10, 10, 5, 3, 2, 8),
                         samplespecies_id = c("1", "3", "3", "4", "4", "6"))
logbook_measure_control(dataframe1, dataframe2, output = "report")
#>   sample_id logical sum_measuredcount sum_count
#> 1         1    TRUE                10        10
#> 2         2    TRUE                15        15
#> 3         3   FALSE                 6         5
#> 4         4   FALSE                 7        NA
#> 5         5   FALSE                NA         8