Last active
August 29, 2015 13:56
-
-
Save tomhopper/9000495 to your computer and use it in GitHub Desktop.
Plot XmR charts (individuals and moving range) in R using the qcc library.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(qcc) | |
#' The data, from sample published by Donald Wheeler | |
my.xmr.raw <- c(5045,4350,4350,3975,4290,4430,4485,4285,3980,3925,3645,3760,3300,3685,3463,5200) | |
#' Create the individuals chart and qcc object | |
my.xmr.x <- qcc(my.xmr.raw, type = "xbar.one", plot = TRUE) | |
#' Create the moving range chart and qcc object. qcc takes a two-column matrix | |
#' that is used to calculate the moving range. | |
my.xmr.raw.r <- matrix(cbind(my.xmr.raw[1:length(my.xmr.raw)-1], my.xmr.raw[2:length(my.xmr.raw)]), ncol=2) | |
my.xmr.mr <- qcc(my.xmr.raw.r, type="R", plot = TRUE) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment