Given a data frame of sample data, a column name, a nominal quantity, and a batch size, calculates the number of non-conformities and determines whether the batch should be accepted, rejected, or subjected to further analysis.

first_noncon_analysis(df, col_name, nominal_quantity, batch_size)

Arguments

df

A data frame containing the sample data for analysis.

col_name

A string representing the name of the column to analyze within the data frame.

nominal_quantity

A numeric value indicating the nominal quantity of the product being produced.

batch_size

A numeric value indicating the size of the batch being produced.

Value

A list with two elements: the decision on whether the batch should be accepted, rejected, or subjected to further analysis, and the input data frame with a new column indicating whether each value in the column being analyzed is acceptable, non-conforming, or unacceptable.

Examples

df <- data.frame(value = c(rep(100, 25),c(99, 99, 99, 99, 91)))
result <- first_noncon_analysis(df, "value", 100, 100)
result$decision
#> [1] "Accept"
result$df
#>    value         status
#> 1    100      Aceptable
#> 2    100      Aceptable
#> 3    100      Aceptable
#> 4    100      Aceptable
#> 5    100      Aceptable
#> 6    100      Aceptable
#> 7    100      Aceptable
#> 8    100      Aceptable
#> 9    100      Aceptable
#> 10   100      Aceptable
#> 11   100      Aceptable
#> 12   100      Aceptable
#> 13   100      Aceptable
#> 14   100      Aceptable
#> 15   100      Aceptable
#> 16   100      Aceptable
#> 17   100      Aceptable
#> 18   100      Aceptable
#> 19   100      Aceptable
#> 20   100      Aceptable
#> 21   100      Aceptable
#> 22   100      Aceptable
#> 23   100      Aceptable
#> 24   100      Aceptable
#> 25   100      Aceptable
#> 26    99      Aceptable
#> 27    99      Aceptable
#> 28    99      Aceptable
#> 29    99      Aceptable
#> 30    91 Non-conformity