[R] graphics with rterm

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed May 7 09:02:45 CEST 2003

On Wed, 7 May 2003 Robin.Thomson at csiro.au wrote:

> I would like to use R as the graphical interface for a fortran program I am
> writing. Presently my fortran code produces a set of data files then sends
> an "rterm ..... <filename.r >out.out" line to my windows system. This causes
> rterm to read in the data files, draw plots on my screen in milliseconds
> .... and then terminate and disappear, plots and all, forever. It's this
> last bit of efficiency that I would like to curb. I would like the graphs to
> appear and stay until I'm ready to dismiss them. 

Then put something in your script to say so when you want it to end.  The
user cannot interact via the keyboard (you have redirected stdin), but you
can put up a dialog box. (See ?winDialog.)

[This has come up several times, so you might want to consult the 

> I would rather not have
> rterm produce my plots as metafiles because I would like them to be
> immediately visible on the screen - I don't want to have to fiddle around
> opening graphics files. 
> Any ideas? Is rterm the right thing to be using?

Probably not, but then Fortran is not conducive to writing interfaces.
Why not call your Fortran from R rather than v.v.?  A more sophisticated 
approach would be to call R via a DCOM server directly from your code, but 
I think that is going to be hard/impossible from a 1950s language.

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 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

More information about the R-help mailing list