[R] non-mouse-sensitive pause between showing plots

Jaan Vajakas jaanvajakas at hot.ee
Thu Oct 2 16:15:53 CEST 2008


Hello,

I am using R version 2.7.2 on Windows. I would like to create a script
that draws many plots and pauses before drawing a new plot, so that I
could copy each plot consecutively to clipboard ("Copy as metafile" from
context menu) or save it to a file ("Save as metafile" from context
menu).

I know that par(ask=TRUE) or devAskNewPage(TRUE) can be used to achieve
something like that, but unfortunately they also accept mouse click as a
confirmation by the user, so that I cannot use the right mouse button to
open the context menu.

Using readline() is also not a good idea because when I execute the
script with Ctrl-R, readline() just eats the subsequent line in the
script instead of waiting until the user presses <Enter> (See e.g. post
http://tolstoy.newcastle.edu.au/R/help/04/11/8089.html which also says
that pause() in package DAAG has similar behaviour because it uses uses
readline()).

I would be satisfied if devAskNewPage had an option that asking new page
would accept keyboard input only, e.g. devAskNewPage("keyboardOnly").


Jaan



More information about the R-help mailing list