shewhart(object, newdata, type, limits, target, std.dev, sizes, labels, label.limits = c("LCL","UCL"), confidence.level = 0.999, nsigmas, add.stats = T, chart.all = F, ylim.min = NULL, rules = shewhart.rules, highlight = list(pch = 1, col = 2), ...)
Subsequent calls to shewhart can pass the return value of a call to shewhart, which includes newdata, in place of object with additional data in the newdata argument.
If limits is missing, shewhart will use the cntrl.limits component of object, if it exists, as the control limits for the chart. If limits is missing and there is not a cntrl.limits component of object, appropriate default functions compute the control limits for the chart. The name of the default function that computes the control limits is formed by pasting together "limits", a period, and the value of type. Thus the control limits of an xbar chart are computed by limits.xbar. By default, probability limits are computed with equal tail probabilities computed as (1 - confidence.level)/2. The control limits are centered in probability about target if it is given, the target component of object if present, or the center component of object, in that order or preference. If nsigmas is given, the control limits are computed as target (or center if target and object$target are missing) plus or minus nsigmas times the standard errors of the group summary statistics. If length(unique(sizes)) > 1, the summary statistics' standard errors will be different, and the control limits are computed as step functions. For more details on how the control limits are computed for Shewhart charts see the help file for the appropriate function (e.g. limits.xbar for the xbar chart).
If limits is given as a vector or matrix, the values specify the control limits. If limits is a function, then it must return a vector or matrix specifying the control limits. If it returns a vector, the first element is the lower control limit and the second element is the upper control limit. If it returns a matrix, the first column corresponds to the lower control limits and the second column corresponds to the upper control limits.
The ylim.min argument can be used to expand the range of the y-axis if additional detail needs to be added to the chart. For example, additional limits can be added to a chart by setting ylim.min appropriately. If the additional limits are in addl.limits, then setting ylim.min = addl.limits will guarantee that the y-axis range is large enough for any subsequent calls to abline or lines. When low level plotting functions are used to add detail to a Shewhart chart, you need to specify add.stats = FALSE in the call to shewhart or else the coordinates will be incorrect for adding detail.
The rules argument specifies a function to determine points which violate a given (set of) rule(s). For example, the beyond.limits function returns the indices of the charted statistics which are beyond the control limits. The indicated points are highlighted according the plotting parameters specified by highlight. Other rules functions which are provided are runs.target for determining all points in a run, for a given run length, above or below the target value and shewhart.rules which combines beyond.limits and runs.target. Although rules can be used in this way to more quickly detect small shifts (on the order of 0.5 - 1.5 standard errors) in the process, cusum charts are preferable. See help(cusum) for more details.
shewhart(qcc(matrix(rnorm(100), ncol = 5), type = "xbar"))