I am trying to run the following R function from qicharts2, however i keep getting the error:
Length of part.labels argument must match the number of parts to label
Vals and Labels are the same size, i am not sure what is going wrong here. I want to draft a control chart with the LCL and UCL pre-calculated.
data <- data.frame(
Sample = 1:24,
xb = c(34.5, 34.2, 31.6, 31.5, 35, 34.1, 32.6, 33.8, 34.8, 33.6, 31.9, 38.6, 35.4, 34, 37.1, 34.9, 33.5, 31.7, 34, 35.1, 33.7, 32.8, 33.5, 34.2),
R = c(3, 4, 4, 4, 5, 6, 4, 3, 7, 8, 3, 9, 8, 6, 5, 7, 4, 3, 8, 4, 2, 1, 3, 2)
)
Labels <- c('UCL','CL','LCL')
Vals <- c(36.721,34.004,31.287)
qic(
xb,
chart="xbar",
decimals=5,
part.labels = Labels,
part = Vals,
show.labels = TRUE
)
A control chart with the UCL, CL and LCL as defined in the vector Vals.