Good morning, I have some problem adding ablines in Rstudio. The lines drew by the software doesen?t match with the added values, what can I do? pfaOK<-qcc(D[!trial], sizes=size[!trial], type="p", nsigmas=2, data.name="Polli positivi al Campylobacter") pfaOK1<-qcc(D[!trial], sizes=size[!trial], type="p", data.name="Polli positivi al Campylobacter") abline(h=pfaOK$limits[1], lty=1, col="red") abline(h=pfaOK$limits[2], lty=1, col="red") abline(h=0.02204175, col="red") abline(h=0.1996249, col="red") abline(h=2.204175, col="red") abline(h=19.96249, col="red") Thanks for the attention, Arianna Inviato da Posta<https://go.microsoft.com/fwlink/?LinkId=550986> per Windows 10 [[alternative HTML version deleted]]
A) Without your data, it is very difficult to see what your problem is. You need to include both data and code to create a reproducible example. [1][2][3] B) Please follow the guidance in the Posting Guide mentioned in the footer of every message on this list; in particular note that this is a plain text mailing list and your message will be damaged to some unpredictable extent if you don't set your email program correctly. [1] http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example [2] http://adv-r.had.co.nz/Reproducibility.html [3] https://cran.r-project.org/web/packages/reprex/index.html (read the vignette) -- Sent from my phone. Please excuse my brevity. On January 29, 2018 3:49:45 AM PST, "a.antonini010 at hotmail.com" <a.antonini010 at hotmail.com> wrote:>Good morning, >I have some problem adding ablines in Rstudio. >The lines drew by the software doesen?t match with the added values, >what can I do? > >pfaOK<-qcc(D[!trial], sizes=size[!trial], type="p", nsigmas=2, >data.name="Polli positivi al Campylobacter") >pfaOK1<-qcc(D[!trial], sizes=size[!trial], type="p", data.name="Polli >positivi al Campylobacter") > >abline(h=pfaOK$limits[1], lty=1, col="red") >abline(h=pfaOK$limits[2], lty=1, col="red") > >abline(h=0.02204175, col="red") >abline(h=0.1996249, col="red") > >abline(h=2.204175, col="red") >abline(h=19.96249, col="red") > >Thanks for the attention, > Arianna > >Inviato da Posta<https://go.microsoft.com/fwlink/?LinkId=550986> per >Windows 10 > > > [[alternative HTML version deleted]]
I assume you are using the qcc package's qcc function. example(qcc) gives an example of adding abline's to its plot: # add warning limits at 2 std. deviations q <- qcc(diameter[1:25,], type="xbar", newdata=diameter[26:40,], plot=FALSE) (warn.limits <- limits.xbar(q$center, q$std.dev, q$sizes, 2)) plot(q, restore.par = FALSE) abline(h = warn.limits, lty = 3, col = "chocolate") and help(qcc) describes the 'restore.par' argument: restore.par: a logical value indicating whether the previous ?par? settings must be restored. If you need to add points, lines, etc. to a control chart set this to ?FALSE?. Bill Dunlap TIBCO Software wdunlap tibco.com On Mon, Jan 29, 2018 at 3:49 AM, a.antonini010 at hotmail.com < a.antonini010 at hotmail.com> wrote:> Good morning, > I have some problem adding ablines in Rstudio. > The lines drew by the software doesen?t match with the added values, what > can I do? > > pfaOK<-qcc(D[!trial], sizes=size[!trial], type="p", nsigmas=2, data.name="Polli > positivi al Campylobacter") > pfaOK1<-qcc(D[!trial], sizes=size[!trial], type="p", data.name="Polli > positivi al Campylobacter") > > abline(h=pfaOK$limits[1], lty=1, col="red") > abline(h=pfaOK$limits[2], lty=1, col="red") > > abline(h=0.02204175, col="red") > abline(h=0.1996249, col="red") > > abline(h=2.204175, col="red") > abline(h=19.96249, col="red") > > Thanks for the attention, > Arianna > > Inviato da Posta<https://go.microsoft.com/fwlink/?LinkId=550986> per > Windows 10 > > > [[alternative HTML version deleted]] > > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/ > posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >[[alternative HTML version deleted]]