Hi all, I am using SPC techniques of plotting Xbar, R, S, P and C charts in R.For this I am using qcc package in R and also using the following document for reference. http://www.stat.unipg.it/~luca/Rnews_2004-1-pag11-17.pdf But while plotting S chart, R chartchart and also C chart I am getting following errors. I have plotted the Xbar chart successfully using following command obj <- qcc(a[,],type="Xbar") But when I use the same command to plot the R chart and S chart jus by replacing the type="Xbar" by type="R" and Type="R" ,I am getting folloiwing error Error in limits.R(center = NA_real_, std.dev = NA_real_, sizes = c(1000L, : group size must be less than 51 when giving nsigmas In addition: Warning message: In sum(sizes * statistics) : Integer overflow - use sum(as.numeric(.)) obj<-qcc(D[trial],sizes=size[trial],type="p") Similarly I am able to plot P chart for defective dataset successfully using following command y<-read.table("Defect_data_2008.csv",sep=",",header=TRUE) attach(y) obj<-qcc(D[trial],sizes=size[trial],type="c") But while plotting C chart I am getitng following error Error in plot.new() : figure margins too large Could u please help me in solving these error. Thanks in advance. -- View this message in context: http://n4.nabble.com/problems-with-SPC-charts-in-R-tp1467901p1467901.html Sent from the R help mailing list archive at Nabble.com.
Please add an reproducible example, so that we can see where it goes wrong. Maybe the error is raised by faulted data? Bart -- View this message in context: http://n4.nabble.com/problems-with-SPC-charts-in-R-tp1467901p1468441.html Sent from the R help mailing list archive at Nabble.com.
ok. I will give the example for which i m getting this error. The data for plotting R chart and S chart is very huge. SO i will take example for plotting C chart. Data is a follows :- sample D size trial 1 11 1000 TRUE 2 11 1000 TRUE 3 13 1000 TRUE 4 11 1000 TRUE 5 14 1000 TRUE 6 12 1000 TRUE 7 17 1000 TRUE 8 7 1000 TRUE 9 7 1000 TRUE 10 6 1000 TRUE 11 9 1000 TRUE 12 3 1000 TRUE 13 2 1000 TRUE 14 4 1000 TRUE 15 13 1000 TRUE 16 11 1000 TRUE 17 7 1000 TRUE 18 11 1000 TRUE 19 8 1000 TRUE 20 5 1000 TRUE 21 37 1000 TRUE 22 11 1000 TRUE 23 9 1000 TRUE 24 4 1000 TRUE 25 7 1000 TRUE 26 4 1000 TRUE 27 17 1000 TRUE 28 11 1000 TRUE 29 18 1000 TRUE 30 21 1000 TRUE 31 18 1000 TRUE 32 19 1000 TRUE 33 12 1000 TRUE 34 11 1000 TRUE 35 13 1000 TRUE Here my sample size is 1000 for each sample no. 1st column corresponds to sample no. 2nd column corresponds to no. of defects 3rd column corresponds to sample size 4th column , I have kept asTRUE because I want to consider whole data for calculating the control limits. The code which i use is as follows :- library(qcc) y<-read.table("Defect_data_2008.csv",sep=",",header=TRUE) attach(y) obj<-qcc(D[trial],sizes=size[trial],type="c") But while plotting C chart I am getitng following error Error in plot.new() : figure margins too large For plotting the pchart if I just change the type="p" then it is plotting correctly without error. -- View this message in context: http://n4.nabble.com/problems-with-SPC-charts-in-R-tp1467901p1468451.html Sent from the R help mailing list archive at Nabble.com.
I suspect that you may have set qcc.options("cex") to too large a value. Try lowering it with qcc.options(cex=whatever) -Peter Ehlers vikrant wrote:> ok. I will give the example for which i m getting this error. The data for > plotting R chart and S chart is very huge. SO i will take example for > plotting C chart. > Data is a follows :- > sample D size trial > 1 11 1000 TRUE > 2 11 1000 TRUE > 3 13 1000 TRUE > 4 11 1000 TRUE > 5 14 1000 TRUE > 6 12 1000 TRUE > 7 17 1000 TRUE > 8 7 1000 TRUE > 9 7 1000 TRUE > 10 6 1000 TRUE > 11 9 1000 TRUE > 12 3 1000 TRUE > 13 2 1000 TRUE > 14 4 1000 TRUE > 15 13 1000 TRUE > 16 11 1000 TRUE > 17 7 1000 TRUE > 18 11 1000 TRUE > 19 8 1000 TRUE > 20 5 1000 TRUE > 21 37 1000 TRUE > 22 11 1000 TRUE > 23 9 1000 TRUE > 24 4 1000 TRUE > 25 7 1000 TRUE > 26 4 1000 TRUE > 27 17 1000 TRUE > 28 11 1000 TRUE > 29 18 1000 TRUE > 30 21 1000 TRUE > 31 18 1000 TRUE > 32 19 1000 TRUE > 33 12 1000 TRUE > 34 11 1000 TRUE > 35 13 1000 TRUE > > Here my sample size is 1000 for each sample no. > 1st column corresponds to sample no. > 2nd column corresponds to no. of defects > 3rd column corresponds to sample size > 4th column , I have kept asTRUE because I want to consider whole data for > calculating the control limits. > The code which i use is as follows :- > > library(qcc) > y<-read.table("Defect_data_2008.csv",sep=",",header=TRUE) > attach(y) > obj<-qcc(D[trial],sizes=size[trial],type="c") > But while plotting C chart I am getitng following error > Error in plot.new() : figure margins too large > > > For plotting the pchart if I just change the type="p" then it is plotting > correctly without error. > >-- Peter Ehlers University of Calgary
I'm sorry, I'm doing this in my spare time, hadn't time during the day. But I tried your example, and didn't get the error. If you get the error with your example (with the data you had sent to this list), then I think Peter is right, and it has something to do with margins you had set. Try to start a new R session, don't set your margins for new plots, and try if this works. Bart -- View this message in context: http://n4.nabble.com/problems-with-SPC-charts-in-R-tp1467901p1469138.html Sent from the R help mailing list archive at Nabble.com.
I'm sorry, I'm doing this in my spare time, hadn't time during the day. But I tried your example, and didn't get the error. If you get the error with your example (with the data you had sent to this list), then I think Peter is right, and it has something to do with margins you had set. Try to start a new R session, don't set your margins for new plots, and try if this works. Bart -- View this message in context: http://n4.nabble.com/problems-with-SPC-charts-in-R-tp1467901p1469147.html Sent from the R help mailing list archive at Nabble.com.
Thanks Bart and Peter for your help and the example is working for c chart as well withut any error. But when I am plotting the R chart i am still getting the following error. Error in limits.R(center = 62614.0571428571, std.dev = NA_real_, sizes c(1000L, : group size must be less than 51 when giving nsigmas I will just explain my example used for plotting R chart. I have around 35 groups and and each group has a sample size of 1000. I want to know whether sample size for each group chosen to be 1000 is a problem. Please help me. -- View this message in context: http://n4.nabble.com/problems-with-SPC-charts-in-R-tp1467901p1469800.html Sent from the R help mailing list archive at Nabble.com.