[R] how to pause between graphics

Greg Snow Greg.Snow at imail.org
Tue Nov 25 17:19:17 CET 2008


If the reason you want to pause is so that you can save a copy of the graph, or go back and look at earlier ones, then it may be easiest to just write all the graphs to a file to start with.  Use the pdf device, write all the graphs to the pdf file, close the file using dev.off, then open the pdf file and page through the graphs.

Not a direct answer to your question, but hope it helps,

--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at imail.org
801.408.8111


> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of Peter B. Mandeville
> Sent: Tuesday, November 25, 2008 6:08 AM
> To: r-help at r-project.org
> Subject: [R] how to pause between graphics
>
> Dear list:
>
>
>
> Before posting this message, I read the posting guide, examined the
> manuals,
> searched the R help files, and examined in detail the books that I have
> available on R.
>
>
>
> I am using R version 2.8.0 and WinXP.
>
>
>
> I want to pause the R Graphics window to permit the use of the File,
> History, and Resize options between each graphic in a series of
> graphics. If
> I use the functions
>
>
>
> par(ask=T)
>
>
>
> or
>
>
>
>        devAskNewPage(ask=T)
>
>
>
> between the graphics there is a pause but one cannot use the File,
> History,
> and Resize options. For an example use
>
>
>
> demo(Graphics)
>
>
>
> What I want to do is approximated by the following code:
>
>
>
> trat <- factor(c(rep("A",5),rep("B",5),rep("C",5)))
>
> trat
>
> resp <-
> c(rnorm(5,mean=5,sd=1.75),rnorm(5,mean=6.5,sd=1.75),rnorm(5,mean=15,sd=
> 1.75)
> )
>
> aovOBJ <- aov(resp~trat)
>
> summary(aovOBJ)
>
>
>
> AOV <- function(aovOBJ){
>
>   print(tmp <- summary.lm(aovOBJ))
>
>   boxplot(tmp$resid,col="grey")
>
>   reply <- readline(prompt="Next:")
>
>   hist(tmp$resid,freq=F,col="grey",breaks="fd",xlab="",ylab="",main="")
>
>   xfit <- seq(min(tmp$resid),max(tmp$resid),length=40)
>
>   yfit <- dnorm(xfit,mean=mean(tmp$resid),sd=sd(tmp$resid))
>
>   lines(xfit,yfit,col="red")
>
>   reply <- readline(prompt="Next:")
>
>   require(car,quietly=T)
>
>   qq.plot(tmp$resid,ylab="empirical",main="",col="black")
>
>   detach("package:car")
>
>   reply <- readline(prompt="Next:")
>
>   plot(density(tmp$resid),main="")
>
>   reply <- readline(prompt="Next:")
>
>   plot.design(aovOBJ$model)
>
>   reply <- readline(prompt="Next:")
>
>   tmp <- TukeyHSD(aovOBJ)
>
>   plot(tmp)
>
> }
>
>
>
> AOV(aovOBJ)
>
>
>
> There ought to exist a lot easier user friendly way to do this. Does
> anyone
> know one?
>
>
>
> Thank you very much,
>
>
>
> pbm
>
>
>
> Peter B. Mandeville
>
> cel:    444 860 3204
>
> tel: 52 444 826 2346-49 ext 532
>
> fax: 52 444 826 2350
>
>
>
> P.D. Favor de confirmar la llegada de este correo. Gracias.
>
>
>
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> 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.



More information about the R-help mailing list