I want to display a series of plots: display plot 1 wait for user input (keypress or mouse click) display plot 2 etc How to do it? Thanks for any help. (I have been using locator().) Bill Simpson -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Tue, 20 Feb 2001, Bill Simpson wrote:> I want to display a series of plots: > > display plot 1 > wait for user input (keypress or mouse click) > display plot 2 > etc > > How to do it? Thanks for any help. > (I have been using locator().)par(ask=TRUE) seems what you need. You can also use readline() to get text input from the user. In general you can't wait on just a keypress (except Return: the input is line-buffered) or on a mouse click (R is not handling GUI events) on Linux, which I seem to recall is your platform. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On 20-Feb-01 Bill Simpson wrote:> I want to display a series of plots: > > display plot 1 > wait for user input (keypress or mouse click) > display plot 2 > etc > > How to do it? Thanks for any help. > (I have been using locator().)par(ask=TRUE) You press return (at the console, not the graphics device window) to see the next plot. Martyn -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Take a look at: demo(graphics) when you are in R. You'll find that it does exactly what you want. Looking into graphics.R code, which is usually in $R_HOME\demos\graphics\ (at least it is in Windows machine), you can see: par(ask = interactive(), .... ) at the beginning. In other words, the if you put "ask = interactive()" (without quotation mark) it should do the job. Ko-Kang Wang ----- Original Message ----- From: "Bill Simpson" <wsi at gcal.ac.uk> To: <r-help at stat.math.ethz.ch> Sent: Tuesday, February 20, 2001 10:04 PM Subject: [R] wait for user input> I want to display a series of plots: > > display plot 1 > wait for user input (keypress or mouse click) > display plot 2 > etc > > How to do it? Thanks for any help. > (I have been using locator().) > > Bill Simpson > > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-> r-help mailing list -- Readhttp://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html> Send "info", "help", or "[un]subscribe" > (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch >_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._. _._ -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Thanks Martyn and Brian for the pointer to par(ask=TRUE) Bill -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._