Given two data frames of sample data, column names, a nominal quantity, and a batch size, concatenates the two data frames, calculates the number of non-conformities, and determines whether the batch should be accepted or rejected.

second_noncon_analysis(
  first_analysis_df,
  first_analysis_col_name,
  second_analysis_df,
  second_analysis_col_name,
  nominal_quantity,
  batch_size
)

Arguments

first_analysis_df

A data frame containing the sample data from the first analysis.

first_analysis_col_name

A string representing the name of the column to analyze in the first analysis data frame.

second_analysis_df

A data frame containing the sample data from the second analysis.

second_analysis_col_name

A string representing the name of the column to analyze in the second analysis 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 three elements: the decision on whether the batch should be accepted or rejected, the first analysis input data frame with a new column indicating whether each value in the column being analyzed is acceptable, non-conforming, or unacceptable, and the second analysis input data frame with a new column indicating whether each value in the column being analyzed is acceptable, non-conforming, or unacceptable.

Examples

first_df <- data.frame(value1 = c(rep(100, 25),c(99, 99, 99, 99, 91)))
second_df <- data.frame(value2 = c(rep(100, 25),c(99, 99, 99, 99, 91)))
result <- second_noncon_analysis(first_df, "value1", second_df, "value2", 100, 100)
result$decision
#> [1] "Accept"
result$df
#> NULL