Description Usage Arguments Value Examples
ggplot stat used to create a mR chart in ggplot
| 1 2 3 4 | 
| mapping | Set of aesthetic mappings created by  | 
| data | The data to be displayed in this layer. There are three options: If  A  A  | 
| geom | The geometric object to use display the data | 
| position | Position adjustment, either as a string, or the result of a call to a position adjustment function. | 
| show.legend | logical. Should this layer be included in the legends?
 | 
| inherit.aes | If  | 
| na.rm | a logical value indicating whether NA values should be stripped before the computation proceeds. | 
| color.mr_point | color, to be used for the mR points. | 
| color.mr_line | color, to be used for line connecting points. | 
| color.qc_limits | color, used to colorize the plot's upper and lower mR control limits. | 
| color.qc_center | color, used to colorize the plot's center line. | 
| ... | Other arguments passed on to  | 
data need to produce the mR plot in ggplot.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | #########################
#  Example 1: mR Chart  #
#########################
# Load Libraries ----------------------------------------------------------
 require(ggQC)
 require(ggplot2)
# Setup Data --------------------------------------------------------------
 set.seed(5555)
 Process1 <- data.frame(processID = as.factor(rep(1,100)),
                        metric_value = rnorm(100,0,1),
                        subgroup_sample=rep(1:20, each=5),
                        Process_run_id = 1:100)
 set.seed(5556)
 Process2 <- data.frame(processID = as.factor(rep(2,100)),
                        metric_value = rnorm(100,5, 1),
                        subgroup_sample=rep(1:10, each=10),
                        Process_run_id = 101:200)
 Both_Processes <- rbind(Process1, Process2)
# One Plot Both Processes -------------------------------------------------
 ggplot(Both_Processes, aes(x=Process_run_id, y = metric_value)) +
   stat_mR() + ylab("Moving Range")
# Facet Plot - Both Processes ---------------------------------------------
 ggplot(Both_Processes, aes(x=Process_run_id, y = metric_value)) +
   stat_mR() + ylab("Moving Range") +
   facet_grid(.~processID, scales = "free_x")
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.