Welcome to the ggQC documentation site. ggQC is a ggplot extension used to create single and multi-facet quality control charts within the ggplot framework using function stat_QC, stat_QC_lines() and stat_mR. Calculate quality control limits using QC_Lines.

Methods supported:

  • Individuals Charts : mR, XmR
  • Attribute Charts : c, np, p, u
  • Studentized Charts: xBar.rBar, xBar.rMedian, xBar.sBar, xMedian.rBar, xMedian.rMedian
  • Dispersion Charts: rBar, rMedian, sBar



Golden_Egg_df <- data.frame(month=1:12,
                 egg_diameter = rnorm(n = 12, mean = 1.5, sd = 0.2)

XmR_Plot <- ggplot(Golden_Egg_df, aes(x = month, y = egg_diameter)) +
               geom_point() + geom_line() + 
               stat_QC(method = "XmR")



  • cran: install.package(“ggQC”)
  • github: devtools::install_github(“kenithgrey/ggQC”)


  • QC_Lines(): Output quality control chart data in table format
  • QC_Violations(): Check for QC Violations
  • stat_QC(): ggplot stat to generate control charts supported methods
  • stat_mR(): ggplot stat to generate mR chart.
  • stat_QC_labels(): ggplot stat to write text labels on control chart center line and limits.
  • stat_qc_violations(): ggplot stat to examine QC Violations.
  • 30 plus functions to calculate specific control chart constants. (recommend using QC_Lines())

Resolved Issues in Version 0.0.2

  • When group size is > 100 stat_QC no longer failes for XbarR type plots and their relatives.

Known Issues