| Title: | Generate XMR Control Chart Data from Time-Series Data |
|---|---|
| Description: | XMRs combine X-Bar control charts and Moving Range control charts. These functions also will recalculate the reference lines when significant change has occurred. |
| Authors: | Alex Zanidean [aut, cre] |
| Maintainer: | Alex Zanidean <AZanidean@mhc.ab.ca> |
| License: | GPL-3 |
| Version: | 1.2.0 |
| Built: | 2026-10-11 10:43:18 UTC |
| Source: | https://github.com/zanidean/xmrr |
Calculates XmR chart statistics and optionally recalculates the central line and natural process limits when short-run or long-run signals are detected.
xmr( df, measure, recalc = TRUE, reuse = TRUE, interval = 5, longrun = c(5, 8), shortrun = c(3, 4), testing = FALSE, prefer_longrun = FALSE )xmr( df, measure, recalc = TRUE, reuse = TRUE, interval = 5, longrun = c(5, 8), shortrun = c(3, 4), testing = FALSE, prefer_longrun = FALSE )
df |
A data frame or tibble containing time-series data. |
measure |
Character string naming the numeric measure column. If omitted, the second column is used. |
recalc |
Logical. Recalculate limits when runs are detected. |
reuse |
Logical. Allow points used in previous run calculations to be reused. Points in the initial interval are always reserved. |
interval |
Number of initial observations used to calculate the starting chart statistics. |
longrun |
Numeric vector of length one or two. The first value is the number of points used for recalculation. The second value is the qualifying consecutive-run length. |
shortrun |
Numeric vector of length one or two. The first value is the number of qualifying points required. The second value is the window size. |
testing |
Logical. Print detected runs and calculation points. |
prefer_longrun |
Logical. Check long runs before short runs. |
Useful for diagnostics on xmr, and just visualizing the data.
xmr_chart( dataframe, time, measure, boundary_linetype = "dashed", central_linetype = "dotted", boundary_colour = "#d02b27", point_colour = "#7ECBB5", point_size = 2, line_width = 0.5, text_size = 9 )xmr_chart( dataframe, time, measure, boundary_linetype = "dashed", central_linetype = "dotted", boundary_colour = "#d02b27", point_colour = "#7ECBB5", point_size = 2, line_width = 0.5, text_size = 9 )
dataframe |
Output from xmR() |
time |
Time column |
measure |
Measure |
boundary_linetype |
Type of line for upper and lower boundary lines. Defaults to "dashed". |
central_linetype |
Type of line for central line. Defaults to "dotted". |
boundary_colour |
Colour of line for upper and lower boundary lines. Defaults to "#d02b27". |
point_colour |
Colour of points. Defaults to "#7ECBB5". |
point_size |
Size of points. Defaults to 2. |
line_width |
Width of lines. Defaults to 0.5. |
text_size |
Size of chart text. Defaults to 9. |
Useful for diagnostics on xmr, and just visualizing the data. Now works with more tidy workflows.
xmr_chart2(dataframe, time, measure, ...)xmr_chart2(dataframe, time, measure, ...)
dataframe |
Output from xmR() |
time |
Time column |
measure |
Measure |
... |
Arguments to pipe to xmr_chart() |
Used to calculate XMR data. Now works with more tidy workflows.
xmr2(dataframe, measure, ...)xmr2(dataframe, measure, ...)
dataframe |
The dataframe or tibble to calculate from. Data must be in a tidy format. At least one variable for time and one variable for measure. |
measure |
The column containing the measure. Must be in numeric format. |
... |
Arguments to pipe to xmr |