1

I am trying to run a script that requires xQuartz. It runs just fine in Rstudio but when I call the script with Rscript , it fails and produces Error in x11() : X11 is not available.

When I run the following, I get this output.

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

If I am reading this correctly, it would seem that my R was not built with X11 support.

To remedy this problem, I tried to reinstall R through homebrew with the command:

brew reinstall R --with-java --with-openblas --with-x --with-cairo

homebrew fails to recognizes --with-x and --with-cairo as options. However, in the proceeding configure text, homebrew explicitly states

./configure --prefix=/usr/local/Cellar/r/3.5.0_1 --enable-memory-profiling --without-cairo --without-x

I tried --without-x=no and --without-cairo=no and both options were not recognized.


How would I make X11 recognizable to Rscript? Is this the right way? If so, how would I install R with those capbailities?

Thank you!

Nicholas Hayden
  • 473
  • 1
  • 3
  • 24
  • Is there a reason for installing R through `homebrew` instead of using the official macOS binaries from CRAN? [This post](https://stackoverflow.com/questions/29017001/r-nightmare-yosemite-r-rstudio-and-homebrew) seems highly relevant to your case. – Maurits Evers Jun 12 '18 at 22:04
  • Thank you for your post! I'll give installing R from the CRAN a try. I just used `homebrew` for ease of use. – Nicholas Hayden Jun 12 '18 at 22:21

0 Answers0