[R] Displaying Grahics to the X Window when calling R from command line
thomas.pologruto at credit-suisse.com
Wed Apr 16 13:56:34 CEST 2008
Thank you for your response. I tried searching the archives but did not
know that it was called X11() device.
Can this be done in version 2.6.2 or do I need to have version 2.7.0
running? Also, when you say wait in my script, I need to put a sleep or
something in the script or else it will delete the plot when the script
Thanks you again,
Please follow the attached hyperlink to an important disclosure:
From: Prof Brian Ripley [mailto:ripley at stats.ox.ac.uk]
Sent: Wednesday, April 16, 2008 3:12 AM
To: Pologruto, Thomas
Cc: r-help at r-project.org
Subject: Re: [R] Displaying Grahics to the X Window when calling R from
The issue is that the X11() device is the default device only in
interactive use, and further than the event loop is only run in
You need to
1) make use of R 2.7.0 RC
2) call R with R --vanilla --interactive
3) arrange for your script to wait for something so the plot remains up.
This has come up before, so please search the archives for more details.
On Tue, 15 Apr 2008, Pologruto, Thomas wrote:
> I am running an R script from the command line by calling:
>> R --vanilla < test.R
> My terminal is part of the Xwin (Xterm) and there is a plot(1:10)
> command in the test.R script.
> This will not produce a grahic though.
I think it does, on a PostScript or PDF file.
> When I start R by calling R then
> plotting from the R command in the same xterm, I do get a graphic
> How do I create a xwin plot by calling R from the command line?
> Any help is most appreciated. I have preprocessed the data in perl
> and then feed it into my R script and want to see a plot on the
> ======== Please access the attached hyperlink for an important
> electronic communications disclaimer:
> [[alternative HTML version deleted]]
> R-help at r-project.org mailing list
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained, reproducible code.
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
Please access the attached hyperlink for an important electronic communications disclaimer:
More information about the R-help