plotCusumEWMA: Plot Cusum & EWMA Plot

Description Usage Arguments Value Examples

View source: R/CusumEWMA.R

Description

Implementation of plot.qcc using ggplot2 and grid

Usage

1
2
3
4
5
plotCusumEWMA(x, add.stats = TRUE, chart.all = TRUE,
  label.limits = waiver(), title = NULL, xlab = NULL, ylab = NULL,
  ylim = NULL, axes.las = 0, digits = getOption("digits"),
  restore.par = TRUE, font.size = 12, size = 4, cex = 4,
  plot.new = TRUE, label.cl = waiver(), ...)

Arguments

x

A qcc object to plot.

add.stats

A boolean flag controlling whether summary statistics are printed on the graph.

chart.all

All boolean flag controlling whether all (old and new) statistics are plotted, or only one or the other

label.limits

A character vector with to elements containing the labels for the lower control limit line and the upper control limit line. The default argument now uses waiver() from ggplot2.

title

A character string containing the desired plot title. If not supplied, a default will be created. If set to element_blank(), the title will not be printed and the control chart will be expanded (i.e. the space normally allocated to the title will be given over to plotting the data).

xlab

A character string containing the desired plot x-axis label. If not supplied, a default will be created.

ylab

A character string containing the desired plot y-axis label. If not supplied, a default will be created.

ylim

A two-element numeric vector containing desired limits for the y axis. If not supplied, a default will be created.

axes.las

An integer indicating the desired orientation of axis labels. See ?par for details. Defaults to 0.

digits

An integer indicating the number of digits to print. See?getOption for details. Defaults to getOption("digits")

restore.par

A boolean indicating whether or not graphic parametersshould be restored. Defaults to TRUE.

font.size

The desired font size in points (pts). Defaults to 12 pts.

label.cl

A character vector with one element containing the label for the central limit line.

Value

A grid object containing the complete plot.

Examples

1
2
3
4
my.xmr.raw <- c(5045,4350,4350,3975,4290,4430,4485,4285,3980,3925,3645,3760,3300,3685,3463,5200)
my.xmr.new <- round(c(runif(5, 3500, 4000)))
x <- qcc(my.xmr.raw, type = "xbar.one", newdata = my.xmr.new, plot = TRUE)
plotCusumEWMA(x)

ivanliu1989/RQuant documentation built on Sept. 13, 2019, 11:53 a.m.