| Title: | Calculate Gauge Repeatability and Reproducibility | 
| Version: | 0.1.0 | 
| Description: | Procedures for calculating variance components, study variation, percent study variation, and percent tolerance for gauge repeatability and reproducibility study. Methods included are ANOVA and Average / Range methods. Requires balanced study. | 
| License: | GPL (≥ 3) | 
| Encoding: | UTF-8 | 
| RoxygenNote: | 7.3.3 | 
| Imports: | dplyr | 
| Suggests: | knitr, rmarkdown, testthat (≥ 3.0.0), readxl, shiny | 
| VignetteBuilder: | knitr | 
| Config/testthat/edition: | 3 | 
| Depends: | R (≥ 3.5) | 
| LazyData: | true | 
| NeedsCompilation: | no | 
| Packaged: | 2025-09-29 10:55:39 UTC; warre | 
| Author: | Jonah Warren [aut, cre] | 
| Maintainer: | Jonah Warren <warren.jonahb@gmail.com> | 
| Repository: | CRAN | 
| Date/Publication: | 2025-10-06 06:00:08 UTC | 
ANOVA Table Calculation
Description
ANOVA Table Calculation
Usage
anova_table(data, part, operator, meas)
Arguments
| data | An R dataframe or tibble. | 
| part | A column in data specifying the unique ID of the part being measured | 
| operator | A column in data specifying the operator for the recorded measurement | 
| meas | A column in data where the measurement value is recorded. | 
Value
An anova table of meas ~ operator x part
Examples
data = data.frame(
SN = c(
'SerialNumber_01',
'SerialNumber_01',
'SerialNumber_02',
'SerialNumber_02',
'SerialNumber_01',
'SerialNumber_01',
'SerialNumber_02',
'SerialNumber_02'),
Operator = c(
'Operator_01',
'Operator_01',
'Operator_01',
'Operator_01',
'Operator_02',
'Operator_02',
'Operator_02',
'Operator_02'),
Measure = c(
0.0172,
0.0177,
0.0155,
0.0159,
0.0174,
0.0181,
0.0152,
0.0176))
anova_table(data, part = 'SN', operator = 'Operator', meas = 'Measure')
ANOVA Variance Component Calculations
Description
ANOVA Variance Component Calculations
Usage
anova_var_calcs(data, part, operator, meas)
Arguments
| data | An R dataframe or tibble. | 
| part | A column in data specifying the unique ID of the part being measured | 
| operator | A column in data specifying the operator for the recorded measurement | 
| meas | A column in data where the measurement value is recorded. | 
Value
A list of numeric values for repeatability, reproducibility, total GRR, part-to-part, and total variance components.
Examples
data = data.frame(
SN = c(
'SerialNumber_01',
'SerialNumber_01',
'SerialNumber_02',
'SerialNumber_02',
'SerialNumber_01',
'SerialNumber_01',
'SerialNumber_02',
'SerialNumber_02'),
Operator = c(
'Operator_01',
'Operator_01',
'Operator_01',
'Operator_01',
'Operator_02',
'Operator_02',
'Operator_02',
'Operator_02'),
Measure = c(
0.0172,
0.0177,
0.0155,
0.0159,
0.0174,
0.0181,
0.0152,
0.0176))
anova_var_calcs(data, part = 'SN', operator = 'Operator', meas = 'Measure')
d2 and c4 Constants for Gage R&R
Description
Functions to calculate the d_2 constant (expected range of a normal subgroup),
the chi-square bias correction factor c_4, and a Minitab-style adjusted
d_2 that incorporates the number of subgroups.
Usage
d2_integral(m, rel.tol = .Machine$double.eps^0.5)
c4(n)
d2_minitab_df(m, g)
Arguments
| m | Integer. Subgroup size (must be  | 
| rel.tol | Relative tolerance for integration (passed to  | 
| n | Integer. Degrees of freedom argument for  | 
| g | Integer. Number of subgroups (must be  | 
Details
-  d2_integral(m)computes the exactd_2(m)by numerical integration.
-  c4(n)computes the chi-square bias correction factorc_4(n).
-  d2_minitab_df(m, g)computes a finite-sample adjusted constantd_2^{adj}(m,g) = d_2(m) / c_4(df), withdf = g \times (m-1)degrees of freedom, consistent with Minitab/AIAG tables.
Value
-  d2_integral()returns a numeric scalar (expected range for subgroup sizem).
-  c4()returns a numeric scalar (bias correction factor).
-  d2_minitab_df()returns a numeric scalar (adjusted constant).
See Also
Examples
# Exact d2 for subgroup size 5
d2_integral(5)
# Chi-square bias correction for df = 8
c4(8)
# Minitab-style adjusted constant for m = 5, g = 2
d2_minitab_df(5, 2)
Measurement System Analysis Data
Description
A collection of sample data to analyze for reproducibility and repeatability measurement error.
Usage
data
Format
data
A data frame with 27 rows and 3 columns:
- SN
- Serial Number 
- Operator
- Operator or Measurement Technician 
- Measure
- Measured Value 
...
Gage R&R Evaluation
Description
Gage R&R Evaluation
Usage
grr_calc(data, part, operator, meas, LSL = NULL, USL = NULL, method = "anova")
Arguments
| data | An R dataframe or tibble containing the required identifier and measurement columns. | 
| part | A string giving the column name specifying the unique ID of the part being measured. The column should be a character or factor. | 
| operator | A string giving the column name specifying the operator for the recorded measurement. The column should be a character or factor. | 
| meas | A string giving the column name where the measurement value is recorded. The column must be numeric and contain no missing or infinite values. | 
| LSL | A number specifying the lower specification limit. | 
| USL | A number specifying the upper specification limit. | 
| method | A string specifying "anova" or "xbar_r". | 
Value
A list containing:
- VarianceComponents: Data frame of variance components and percent contribution 
- GageEval: Data frame of study variation metrics 
- AnovaTable: ANOVA table (if method = "anova") 
Examples
data <- data.frame(
  SN = rep(c("SerialNumber_01","SerialNumber_02"), each = 4),
  Operator = rep(c("Operator_01","Operator_02"), each = 2, times = 2),
  Measure = c(0.0172,0.0177,0.0155,0.0159,0.0174,0.0181,0.0152,0.0176)
)
grr_calc(data, part = "SN", operator = "Operator",
         meas = "Measure", LSL = 0, USL = 0.040, method = "xbar_r")
Average and Range Method Part-to-Part Variance Calculation
Description
Average and Range Method Part-to-Part Variance Calculation
Usage
part_to_part(data, part, meas)
Arguments
| data | An R dataframe or tibble containing the required identifier and measurement columns. | 
| part | Column name (unquoted) specifying the unique ID of the part being measured. The column should be a character or factor vector. | 
| meas | Column name (unquoted) where the measurement value is recorded. The column must be numeric and contain no missing or infinite values. | 
Value
A number. The measure of part-to-part variation for the given data.
Examples
data <- data.frame(
  SN = rep(c("SerialNumber_01","SerialNumber_02"), each = 4),
  Operator = rep(c("Operator_01","Operator_02"), each = 2, times = 2),
  Measure = c(0.0172,0.0177,0.0155,0.0159,0.0174,0.0181,0.0152,0.0176)
)
part_to_part(data, part = 'SN', meas = 'Measure')
ANOVA Sum of Squares Calculations
Description
ANOVA Sum of Squares Calculations
Usage
ss_calcs(data, part, operator, meas)
Arguments
| data | An R dataframe or tibble containing the required identifier and measurement columns. | 
| part | A column in data specifying the unique ID of the part being measured. The column should be a character or factor vector. | 
| operator | A column in data specifying the operator for the recorded measurement. The column should be a character or factor vector. | 
| meas | A column in data where the measurement value is recorded. The column must be numeric and contain no missing or infinite values. | 
Value
A list of numeric values for the sum of squares error for operator, part, equipment, operator and part interaction, and total error.
Examples
data = data.frame(
SN = c(
'SerialNumber_01',
'SerialNumber_01',
'SerialNumber_02',
'SerialNumber_02',
'SerialNumber_01',
'SerialNumber_01',
'SerialNumber_02',
'SerialNumber_02'),
Operator = c(
'Operator_01',
'Operator_01',
'Operator_01',
'Operator_01',
'Operator_02',
'Operator_02',
'Operator_02',
'Operator_02'),
Measure = c(
0.0172,
0.0177,
0.0155,
0.0159,
0.0174,
0.0181,
0.0152,
0.0176))
ss_calcs(data, part = 'SN', operator = 'Operator', meas = 'Measure')
Average and Range Method Repeatability Calculation
Description
Average and Range Method Repeatability Calculation
Usage
xbar_repeat(data, part, operator, meas)
Arguments
| data | An R dataframe or tibble containing the required identifier and measurement columns. | 
| part | Column name (unquoted) specifying the unique ID of the part being measured. The column should be a character or factor vector. | 
| operator | Column name (unquoted) specifying the operator for the recorded measurement. The column should be a character or factor vector. | 
| meas | Column name (unquoted) where the measurement value is recorded. The column must be numeric and contain no missing or infinite values. | 
Value
A number. The measure of repeatability for the given data.
Examples
data <- data.frame(
  SN = rep(c("SerialNumber_01","SerialNumber_02"), each = 4),
  Operator = rep(c("Operator_01","Operator_02"), each = 2, times = 2),
  Measure = c(0.0172,0.0177,0.0155,0.0159,0.0174,0.0181,0.0152,0.0176)
)
xbar_repeat(data, part = 'SN', operator = 'Operator', meas = 'Measure')
Average and Range Method Reproducibility Calculation
Description
Average and Range Method Reproducibility Calculation
Usage
xbar_reproduce(data, part, operator, meas)
Arguments
| data | An R dataframe or tibble containing the required identifier and measurement columns. | 
| part | Column name (unquoted) specifying the unique ID of the part being measured. The column should be a character or factor vector. | 
| operator | Column name (unquoted) specifying the operator for the recorded measurement. The column should be a character or factor vector. | 
| meas | Column name (unquoted) where the measurement value is recorded. The column must be numeric and contain no missing or infinite values. | 
Value
A number. The measure of reproducibility for the given data.
Examples
data <- data.frame(
  SN = rep(c("SerialNumber_01","SerialNumber_02"), each = 4),
  Operator = rep(c("Operator_01","Operator_02"), each = 2, times = 2),
  Measure = c(0.0172,0.0177,0.0155,0.0159,0.0174,0.0181,0.0152,0.0176)
)
xbar_reproduce(data, part = 'SN', operator = 'Operator', meas = 'Measure')
Average and Range Method Variance Component Summary
Description
Average and Range Method Variance Component Summary
Usage
xbar_varcomps(data, part, operator, meas)
Arguments
| data | An R dataframe or tibble. | 
| part | Column name (unquoted) specifying the unique ID of the part being measured. | 
| operator | Column name (unquoted) specifying the operator for the recorded measurement. | 
| meas | Column name (unquoted) where the measurement value is recorded. | 
Value
A list of numeric values for repeatability, reproducibility, total GRR, part-to-part, and total variance components.
Examples
data <- data.frame(
  SN = rep(c("SerialNumber_01","SerialNumber_02"), each = 4),
  Operator = rep(c("Operator_01","Operator_02"), each = 2, times = 2),
  Measure = c(0.0172,0.0177,0.0155,0.0159,0.0174,0.0181,0.0152,0.0176)
)
xbar_varcomps(data, part = 'SN', operator = 'Operator', meas = 'Measure')