问题
I have a control chart below that I am plotting from the data random
(data sample posted on the bottom),
All what I am trying to do is add a horizontal line that I specify the value of to this control chart. I tried looking at new.data
to add in qcc but its plotting a complete new thing
Please help me with this, thanks alot.
The code below shows how I plotted it
attach(random)
library(qcc)
E6LA <-qcc.groups(xdata,ydata)
obj1 <- qcc(E6LA, type="xbar",nsigmas=3, plot = "FALSE",
confidence.level = 0.95)
summary(obj1)
plot(obj1,restore.par = FALSE, type ="1", title = "Data for Stability per year",
xlab = "Year_WW",ylab = "Stability")
The sample data is below posted:
xdata ydata
1 2016-01 63.87
2 2016-02 59.31
3 2016-03 78.60
4 2016-04 90.54
5 2016-05 83.04
6 2016-06 77.61
7 2016-07 131.60
8 2016-08 92.36
9 2016-09 77.75
10 2016-10 83.70
11 2016-11 93.76
12 2016-12 67.68
13 2016-13 77.04
14 2016-14 56.59
15 2016-15 68.91
16 2016-16 82.75
17 2016-17 64.29
18 2016-18 189.00
19 2016-19 162.75
20 2016-20 125.21
21 2016-21 140.89
22 2016-22 95.49
23 2016-23 76.52
来源:https://stackoverflow.com/questions/38056822/adding-line-to-plot-in-qcc-control-chart