luca-scr / qcc

An R package for Quality Control Charts
https://luca-scr.github.io/qcc/
43 stars 17 forks source link

oc curves for R and S type qcc objects do not plot #31

Closed erblast closed 3 years ago

erblast commented 3 years ago

Hi there, I found another bug

library(qcc)
#> Loading required package: ggplot2
#> Package 'qcc' version 3.0
#> Type 'citation("qcc")' for citing this R package in publications.
data(pistonrings)
diameter <- qccGroups(data = pistonrings, diameter, sample)
(q2 <- qcc(diameter[1:25,], type = "R"))
#> ── Quality Control Chart ───────────────────────── 
#> 
#> Chart type                 = R 
#> Data (phase I)             = diameter[1:25, ] 
#> Number of groups           = 25 
#> Group sample size          = 5 
#> Center of group statistics = 0.02276 
#> Standard deviation         = 0.009785039 
#> 
#> Control limits at nsigmas  = 3 
#>  LCL        UCL
#>    0 0.04812533
q2_oc <- qcc::ocCurves(q2)
plot(q2_oc)
#> Error: Insufficient values in manual scale. 5 needed but only 0 provided.

(q4 <- qcc(diameter[1:25,], type = "S"))
#> ── Quality Control Chart ───────────────────────── 
#> 
#> Chart type                 = S 
#> Data (phase I)             = diameter[1:25, ] 
#> Number of groups           = 25 
#> Group sample size          = 5 
#> Center of group statistics = 0.009240037 
#> Standard deviation         = 0.009829977 
#> 
#> Control limits at nsigmas  = 3 
#>  LCL        UCL
#>    0 0.01930242
q4_oc <- qcc::ocCurves(q4)
plot(q4_oc)
#> Error: Insufficient values in manual scale. 5 needed but only 0 provided.
tjfarrar commented 3 years ago

I was going to log an issue (based on the current CRAN version of the package) about how the OC curve plots for R and S qcc objects strictly begin from 1 on the horizontal axis, whereas one may want to include multiplier values less than 1 to monitor the control chart's ability to detect downward changes in process standard deviation. However, I see that this issue has already been addressed in the new-and-improved OC curve plotting function in the Github version.