Quality Improvement Charts

Functions for making run charts and basic Shewhart control charts for measure and count data. The main function, qic(), creates run and control charts and has a simple interface with a rich set of options to control data analysis and plotting, including options for automatic data aggregation by subgroups, easy analysis of before-and-after data, exclusion of one or more data points from analysis, and splitting charts into sequential time periods. Missing values and empty subgroups are handled gracefully.

qicharts will no longer be maintained. Please consider moving to qicharts2: https://anhoej.github.io/qicharts2/.

The qicharts package contains functions for plotting run charts and Shewhart control charts for measure and count data.

The main function is qic(), which in its simplest form takes a vector of values, plots a run chart, and performs tests for non-random variation in the data sequence. Non-random variation may be the result of deliberate process improvement or unintentional, possibly unwanted, changes in process performance.

qic() has a simple interface with a rich set of options to control data analysis and plotting, including options for automatic data aggregation by subgroups, easy analysis of before-and-after data, exclusion of one or more data points from analysis, and splitting charts into sequential time periods. Missing values and empty subgroups are handled gracefully.

The trc() function creates trellis run charts, i.e. small multiple run charts from multivariate data.

tcc() is an experimental function aiming at replacing trc() and, eventually, qic(). It allows for multivariate run and control charts in trellis layout.

The paretochart() function plots a pareto chart from categorical data.

For quick demos, run


Then read the help files


Install latest release version of qicharts from CRAN


Or install development version from GitHub



qicharts 0.5.5

  • This is the last version og qicharts. Instead look to qicharts2.
  • Added "no longer maintained" startup message.
  • Fixed bug in the formatting of labels for control limits and center line when using user-specfied number of decimals. Previously, trailing zeros were not shown. (Karl Ove Hufthammer, @huftis)

qicharts 0.5.4

  • Added caption and subtitle arguments to tcc().
  • Better placement of centre line labels in tcc() charts.
  • Better rounding of centre line labels in tcc() charts.
  • Better looking notes in tcc() charts.
  • Dashed red center lines mark non-random variation in tcc() charts.
  • Fixed the "Each group consist of only one observation" warning for categorical x axis in tcc().
  • Fixed a bug in the calculation of the centre line in S charts when using the freeze argument.

qicharts 0.5.3

  • Fixed vignette file dates

qicharts 0.5.2

  • Fixed bug in tcc() that in some situations would read any object named d4 from the parent environment.
  • Added space to top margin in paretochart().
  • Fixed resetting of graphical parameters after plotting in qic() and paretochart().
  • Build with R 3.3.2.

qicharts 0.5.1

  • Included details of runs analysis in summary.tcc().
  • Fixed missing axis lines in tcc() with ggplot 2.1.0: https://github.com/hadley/ggplot2/issues/1567.
  • Centre line labels in tcc() now matches y labels if y.percent = TRUE.
  • Runs analysis now disregards excluded data points in tcc().
  • Fixed warning message from runs analysis in tcc() if all data points are on the median.

qicharts 0.5.0

  • tcc() now returns a ggplot object, which makes it possible to apply custom themes and functions to plots and extract individual components of the plot object for further study and manipulation.
  • Naming and ordering of tcc() arguments has been modified for consistency. NOTE: This may break your code. See ?tcc() for details.
  • New generic function summary.tcc() for summarising tcc object.
  • tcc() gained argument print.summary for printing summary of tcc() object.)
  • plot and print arguments of tcc() have been deprecated.
  • tcc() imports ggplot >= 2.0.0.
  • tcc() imports ggrepel. Used with the notes argument for annotating tcc() plots.
  • tcc() gained notes argument for adding annotations to individual data points.
  • tcc() gained y.percent argument for formatting y axis as percent.
  • tcc() gained cl.lab argument for adding center line labels to tcc() plots.
  • tcc() gained xpad argument for adjusting the space available for center line labels.
  • tcc() gained target argument for adding a target line to plots.
  • Darker red colour of centre line to signal non-random variation in tcc() plots.
  • Reduced base_size (font sizes) in tcc() from 12 to 11. After RStudio 0.99.724 fixed a bug that reduced the font size of grid based graphics, the default seemed to big. Use cex argument to adjust font size.
  • Increased spacing between axes and titles in tcc().
  • "Traffic light" feature of qic() and trc() has been deprecated.
  • Code cleanup of qic() and trc().
  • Reduced font size in trc() plots.
  • Fixed clipping of cumulative curve in paretochart().

qicharts 0.4.3

  • Added centre and control line value label to single panel plots in tcc().
  • New argument, dec, to tcc() specifying the number of decimals in line labels.
  • Fixed issue with empty subgroups being summed to 0 rather than NA in tcc().
  • Fixed "infinite" control limits in tcc().
  • Fixed loading errors caused by imports from scales.

qicharts 0.4.2

  • Removed empty levels from data frame in tcc().
  • Fixed a bug in qic() that handles run charts with more than half of the data points having same value.

qicharts 0.4.1

  • Fixed undefined globals

qicharts 0.4.0

  • New experimental function, tcc(), trellis control charts. Aims at replacing trc() and, eventually, qic(). Allows for multivariate run and control charts in lattice (grid) layout.
  • New argument, direction, in qic() and trc() functions. Adds an up or down arrow indicating the desired direction of improvement to qic plots and is used together with the target argument to colour code the centre line in qic and trc plots.
  • Added colour coding of centre line. Red means stable process on the wrong side of the target. Green means stable process on the right side of the target. Amber means unstable process (= non-random variation is present).
  • Fixed a calculation error in T chart
  • Median line is suppressed in run charts if more than half of the data points have the same value.

qicharts 0.3.2

  • Fixed handling of missing data in prime charts.
  • primed argument in qic() function is deprecated, use prime instead.
  • Minor adjustments to plot margins.
  • New argument, agg.fun, in qic() function. Specifies the aggregate function if there is more than one value per subgroup.

qicharts 0.3.1

  • Fixed undefined globals in package

qicharts 0.3.0

  • New argument, sub, in qic() function. Prints a subtitle at lower left corner.
  • New function, plot.qic(), plots a qic object.
  • qic() now returns a list object of class 'qic' for plotting with plot.qic().
  • prnt argument in qic() function will be deprecated, use print.out instead.
  • New vignette "controlcharts".
  • Vignette "runcharts" updated.

qicharts 0.2.0

  • Added nint argument to qic() function control the number of tick marks on the x axis.
  • Fixed target argument of qic() function to obey multiply argument.
  • cl argument of qic() function now takes a vector of length either one or the number of subgroups (for variable centre line in run charts).
  • Minor code clean-up.
  • Added cex argument to trc() function to control dot size (thanks to John MacKintosh, @HighlandAnalyst).
  • Added gap argument to trc() function to control spacing between panels.
  • Added target argument to trc() function.
  • Title of trellis run charts is now left justified and of normal font weight (thanks to Markus Gesmann, www.magesblog.com).
  • Fixed a typo in graph output (usefull -> useful).
  • Added two recent run chart references to help section and vignette.

qicharts 0.1.3

  • Improved graph design based on the principles of Stephen Few (perceptualedge.com).
  • Added argument to produce I control charts in trc() function.
  • Added argument 'primed' to the qic() function, correcting narrow control limits when using P or U charts on data involving very large sample sizes.
  • Added argument 'standardised' to the qic() function. When using P, U or Xbar charts, this allows the plotting of data points in standard deviation units with control limits at -3 and 3 along with a centre line at zero.
  • If so desired, P and U charts can be primed and standardised at the same time.
  • Smart rounding (to at least two significant digits) is used by default for median labels in trc charts. The 'dec' argument still provides manual control if needed.
  • Smart rounding is also the default for central line and control limit labels in qic charts. The 'decimals' argument allows manual control of decimal digits.

qicharts 0.1.2

  • Set control limits outside possible range to NA in T, P, U, and G charts.

qicharts 0.1.1

  • The trc() function now returns a lattice object.
  • Added arguments to control printing character and colours in trc() function.
  • Added dec argument to control the number of decimals on the label of the centre line in trc() function.
  • The qic() function now plots the main curve on top of other lines in the plot.
  • Fixed an error caused if data frame argument holds a data frame created with the group_by function from dplyr.

qicharts 0.1.0

  • First release.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


0.5.5 by Jacob Anhoej, 6 months ago

Browse source code at https://github.com/cran/qicharts

Authors: Jacob Anhoej [aut, cre], Timo Roeder [ctb]

Documentation:   PDF Manual  

GPL-3 license

Imports lattice, latticeExtra, graphics, grDevices, stats, scales, ggplot2

Suggests knitr

Imported by boxcoxmix.

Suggested by agridat.

See at CRAN