[R] Using jpeg() without X

mic mikezian11 at gmail.com
Wed Jul 28 07:46:15 CEST 2010


When I tried this, I'm having this error. Can somebody help me on
this. Are there any alternatives or workaround for this? I'm having
hard time to convince our admin to install X11 library and headers
since they are not included on the default OS installation.

Thanks in advance :)

> jpeg("test.jpg")
Error in jpeg("test.jpg") : X11 is not available

> sessionInfo()
R version 2.11.1 (2010-05-31)
i686-pc-linux-gnu

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
 [5] LC_MONETARY=C              LC_MESSAGES=en_US.UTF-8
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

> capabilities()
    jpeg      png     tiff    tcltk      X11     aqua http/ftp
sockets
   FALSE    FALSE    FALSE    FALSE    FALSE    FALSE     TRUE
TRUE
  libxml     fifo   cledit    iconv      NLS  profmem    cairo
    TRUE     TRUE     TRUE     TRUE     TRUE    FALSE    FALSE


Seems that libjpeg is available on our server
[root at localhost R-2.11.1]# locate libjpeg
/usr/lib/libjpeg.so
/usr/lib/libjpeg.so.62
/usr/lib/libjpeg.so.62.0.0

I'm using Fedora 12 and compiled the newest version of r-project.
Here are my steps I've taken before I run that command

./configure --with-x=no --with-tcltk=no

Here's the message after the command...
R is now configured for i686-pc-linux-gnu

  Source directory:          .
  Installation directory:    /usr/local

  C compiler:                gcc -std=gnu99  -g -O2
  Fortran 77 compiler:       gfortran  -g -O2

  C++ compiler:              g++  -g -O2
  Fortran 90/95 compiler:    gfortran -g -O2
  Obj-C compiler:

  Interfaces supported:
  External libraries:        readline
  Additional capabilities:   JPEG, NLS
  Options enabled:           shared BLAS, R profiling, Java

  Recommended packages:      yes
...

make
make install
R
> jpeg("test.jpg")
Error in jpeg("test.jpg") : X11 is not available



More information about the R-help mailing list