Skip to contents

facet_stages

Usage

facet_stages(data, split_rows, plot_chart = TRUE, ...)

Arguments

data

A data frame. For an XMR, C or C' chart, must have columns for:

  • the subgrouping variable, to be plotted on the horizontal axis, (x);

  • the variable of interest to be plotted on the vertical axis (y);

  • and optionally, a title and subtitle for the plot.


For a P or P' chart, must have columns for:

  • the subgrouping variable, to be plotted on the horizontal axis, (x);

  • the total count or denominator (n);

  • the count meeting criteria, or numerator (y);

  • and optionally, a title and subtitle for the plot.

split_rows

A vector of row numbers specifying the stages to display results at. Names specify facet strip labels.

plot_chart

Boolean specifying whether to plot the chart. If not, the data is returned with centre line, control limits and other analytic output appended as columns.

...

Arguments passed to autospc()

Value

Faceted plot showing results of autospc() at different stages as specified by split_rows

Examples

# Show progression of C' chart for count of monthly attendances over time
facet_stages(
  ed_attendances_monthly,
  split_rows = c(30L, 60L, 90L),
  chart_type = "C'",
  x = month_start,
  y = att_all, 
  x_break = 365
)