Skip to content

X11 png jpeg cledit false when running from script

3 messages · Jon Dressel, Marc Schwartz, Brian Ripley

#
On Wed, 2005-12-14 at 15:53 -0800, Jon Dressel wrote:
Without the script you are using and perhaps how you installed R, it is
hard to provide specific details here, especially given the differences
you are observing between FC3 and 4.

In general, cledit being FALSE suggests that R is being run
non-interactively. So I am guessing that you are calling R from the
command line in some fashion and running a R program via stdin
redirection or running R in BATCH mode. For example:

$ echo "capabilities()" | R --slave --vanilla
    jpeg      png    tcltk      X11 http/ftp  sockets   libxml     fifo
    TRUE     TRUE     TRUE     TRUE     TRUE     TRUE     TRUE     TRUE
  cledit    iconv      NLS
   FALSE     TRUE     TRUE

Note however that jpeg, png and X11 are all TRUE as I ran the above from
a console with X running on my FC 4 laptop using GNOME.

That jpeg, png and X11 are FALSE when running your script suggests that
the actual machine you are running R on in that instance is not running
an X server. That is what I get, for example, when I change to init 3
(text mode) and run the above again from the command line.

Are you running a remote login session of some type to a box that is not
running X or is your script calling a remote R session?

If so and you need to be able to generate plots, you can use bitmap()
which does not require X to be running, or you can also use Xvfb on the
other box, which is the X virtual frame buffer. See 'man Xvfb' for more
information.

I do the latter when performing certain analyses on a RHEL server
running Oracle 10g, where we have integrated some online reporting
functionality for clients. I wrote some R programs which create PNG
plots as required. Our DBA's call/run the R programs on the server via
TCL code and then put the resultant plots into an HTML page created
dynamically. The server is not running X, so we use Xvfb.

You might also want to see R FAQ 7.19 How do I produce PNG graphics in
batch mode?, which covers the above.

HTH,

Marc Schwartz
#
It could be as simple as not having DISPLAY set when running the script.

capabilities() first checks there is a display specified, then that it can 
be opened.  SELinux (which my FC3 box runs) does from time to time get in 
the way (a month or so ago it stopped scripts accessing Xvfb), but usually 
this is solved by updating/downdating the policies.

Marc Schwartz mentioned bitmap(): there is also package GDD if you can get 
that to run (it runs for me on i386 FC3, but not on x86_64 FC3)
On Wed, 14 Dec 2005, Jon Dressel wrote: