[R] How can I run package ca (correspondence analysis), which needs rgl, without X11?

Jocelyn Ireson-Paine popx at j-paine.org
Mon Apr 23 18:05:41 CEST 2012


I want to invoke R on a Linux Web server from Java, in order to analyse 
data in ways that would take too long to code, and run too slowly, in 
Java. In particular, to do correspondence analyses. To this end, I've 
installed R version 2.15.0 on my Web host's x86_64 GNU/Linux machine, and 
tried using package "ca" to run the "author" example of correspondence 
analysis on page 3 of http://cran.r-project.org/web/packages/ca/ca.pdf .

But there's a problem anent X11. My Web host's Linux doesn't have X11, and 
its administrator says that it would be hairy for him to install, because 
of its dependencies. So when I installed R, I did so without X11. Since 
I'm not going to plot graphs interactively, I wasn't expecting to need it 
anyway.

However, I find that ca requires it. When I did
   install.packages("ca")
(from Bristol mirror), it downloaded rgl_0.92.879.tar.gz and 
ca_0.33.tar.gz, then started its checks, and then complained:
   checking for X... no
   configure: error: X11 not found but required, configure aborted.
   ERROR: configuration failed for package 'rgl'
   * removing '/home/jp/r/R-2.15.0/library/rgl'
   ERROR: dependency 'rgl' is not available for package 'ca'
   * removing '/home/jp/r/R-2.15.0/library/ca'

Why? Not all uses of ca require X11. For example, if you merely call the 
ca function without plotting anything, that surely can't need it. 
Moreover, one can plot to PDF without needing X11. I managed to do so from 
another correspondence-analysis package, ade4, by redirecting my plot to 
PDF and then running the Bordeaux example near the top of 
http://pbil.univ-lyon1.fr/ade4/ade4-html/bordeaux.html . (I then converted 
the PDF to PNG using ImageMagick.) So if ade4 can do this, ca ought to be 
able to. How can I make it? I don't mind ca complaining when it indeed 
does need X11, but couldn't the dependency check be postponed until 
runtime, so as not to spoil things for people to whom it's irrelevant?

Thanks,

Jocelyn Ireson-Paine
http://www.j-paine.org

Jocelyn's Cartoons:
http://www.j-paine.org/blog/jocelyns_cartoons/



More information about the R-help mailing list