R/logbook_weight_sample_control.R
logbook_weight_sample_control.Rd
The purpose of the logbook_weight_sample_control function is to provide a table of data that contains an inconsistency between the sample weight (m10 and p10) and the global weight
logbook_weight_sample_control(dataframe1, output)
data.frame expected. Csv or output of the function data_extraction, which must be done before using the logbook_weight_sample_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 :
sample_id
sample_smallsweight
sample_bigsweight
sample_totalweight
#Sample 1, and 2 are ok,
#Sample 3 has total weight and smalls weight,
#Sample 4 has not total weight nor smalls weight nor bigs weight
dataframe1 <- data.frame(sample_id = c("1", "2", "3", "4"),
sample_smallsweight = c(10, NA, 12, NA),
sample_bigsweight = c(50, NA, NA, 0),
sample_totalweight = c(NA, 9, 5, 0))
logbook_weight_sample_control(dataframe1, output = "report")
#> sample_id logical sample_totalweight sample_smallsweight sample_bigsweight
#> 1 1 TRUE NA 10 50
#> 2 2 TRUE 9 NA NA
#> 3 3 FALSE 5 12 NA
#> 4 4 FALSE 0 NA 0