# NOT RUN {
# Key in data (10 subgroups with 5 observations each).
x1 = c(4.13, 5.97, 5.54, 5.26, 5.73)
x2 = c(4.11, 6.27, 5.84, 5.17, 5.24)
x3 = c(4.51, 4.83, 5.67, 5.99, 5.85)
x4 = c(3.77, 3.78, 5.69, 4.31, 4.42)
x5 = c(4.83, 5.15, 3.83, 3.48, 2.52)
x6 = c(4.25, 3.66, 5.23, 5.96, 4.75)
x7 = c(4.93, 5.17, 6.44, 4.19, 4.42)
x8 = c(5.28, 4.83, 7.94, 4.89, 3.51)
x9 = c(4.58, 5.60, 5.84, 6.22, 4.54)
x10= c(5.14, 4.31, 3.23, 6.95, 5.35)
data = rbind(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)
# Print LCL, CL, UCL.
result = rcc(data)
print(result)
# Plot a control chart
xbar = rowMeans(data)
plot(xbar, type="b", ylim=range(result,xbar) )
abline(h=result, lty=2, col="red")
# }
Run the code above in your browser using DataLab