Calculates the required sample size for a given batch size and analysis type, based on a reference table of sample sizes.

get_sample_sizes(batch_size, analysis)

Arguments

batch_size

A numeric value indicating the batch size for which the sample size is to be calculated.

analysis

A string value indicating the type of analysis for which the sample size is to be calculated. Must be either "first" or "second".

Value

A numeric value indicating the required sample size for the given batch size and analysis type. If the batch size is outside the range of the reference table, or if the analysis parameter is not valid, the function returns an error message.

Examples

get_sample_sizes(300, "first")
#> [1] 30
get_sample_sizes(1500, "second")
#> [1] 50