[R] rterm.exe and graphics windows

ripley@stats.ox.ac.uk ripley at stats.ox.ac.uk
Sun May 19 21:20:39 CEST 2002


On Sun, 19 May 2002, Mike Prager wrote:

> I have started using R 1.5.0 on Windows 2000. The refinement of this system
> in such a short time is astounding, and I thank those who have worked on it
> and made it available!
>
> I have been using rterm.exe to develop R scripts in my preferred editor
> (not emacs) by sending the command
>
> rterm.exe --save < %f
>
> where the editor substitutes the filename for %f.  This works wonderfully,
> and the editor captures the output in a process buffer!  One drawback is
> that even though rterm (unlike sqpe) can start a graphics window, it is
> closed at the end of the script, so I never get to look at the graph.  I
> have been writing the graph instead to a png file and using system() to
> open a graphics viewer from the script, but I would like to avoid that
> kludge. Can I force the graphics window to stay open until a key is struck?

The way you are running this, rterm has no connection to a keyboard, so
the answer is no. What you can do is wait until a quit dialog box is
clicked on.  Here's an example

windows()
plot(1:10)
winDialog("ok", "click to quit")
q()

If you can arrange to pipe input to rterm, lots of other possibilities
exist, in particular those used for ESS (which uses switch --ess).

-- 
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list