[R] Sweave and X11 on OSX 10.3

Friedrich.Leisch@ci.tuwien.ac.at Friedrich.Leisch at ci.tuwien.ac.at
Wed Jan 7 16:52:02 CET 2004


>>>>> On Tue, 6 Jan 2004 23:44:42 -0700 (MST),
>>>>> Kieran Healy (KH) wrote:

  > Hi -
  > I'm running R 1.8.1 (compiled from source) on Mac OS X 10.3 (Panther). I
  > find that, if Apple's X11 application is not running, Sweave gives an
  > error when it wants to create a pdf or eps figure. E.g., in the package's
  > own example-1.Snw file a boxplot is created at chunk 2:

  > <<fig=TRUE,echo=FALSE>>=
  > boxplot(Ozone ~ Month, data = airquality)
  > @

  > Normally this will create a pdf and an eps version of the boxplot. I get:

  >> Sweave("example-1.Snw")
  > Writing to file example-1.tex
  > Processing code chunks ...
  >  1 : echo term verbatim
  >  2 : term verbatim eps pdf
  > Warning message:
  > unable to open connection to X11 display`'

  > Error:  chunk 2
  > Error in X11(display, width, height, pointsize, gamma, colortype,
  > maxcubesize,  :
  >         unable to start device X11

  > If I start the X11 application, Sweave runs as normal but displays any
  > figures on an x11() device in addition to creating the eps / pdf files.

  > I don't remember this happening before and experience teaches me to assume
  > the issue is with my own setup rather than Sewave. Maybe there's a
  > problem with the DISPLAY variable, or something that I did while upgrading
  > to Panther -- but I can't see what it is. Has anyone else had this
  > issue?

Your R session has obviously x11() as the default plotting device
... e.g.,

	plot(1:10)

at the prompt should also give an error, if no graphics device is
open. I don't know too much about MacOS X, but having the DISPLAY
variable set without having an X11 server surely means asking for
trouble on Linux, and I guess MacOS X is not different ...

-- 
-------------------------------------------------------------------
                        Friedrich Leisch 
Institut für Statistik                     Tel: (+43 1) 58801 10715
Technische Universität Wien                Fax: (+43 1) 58801 10798
Wiedner Hauptstraße 8-10/1071      Friedrich.Leisch at ci.tuwien.ac.at
A-1040 Wien, Austria             http://www.ci.tuwien.ac.at/~leisch




More information about the R-help mailing list