[R] X11 device

Paul Roebuck roebuck at mdanderson.org
Wed May 31 23:03:12 CEST 2006


On Wed, 31 May 2006, Marius Hofert wrote:

> I am working with R on a Mac Powerbook G4. As described a couple of
> days ago, I would like to create an animation consisting of - say -
> 1000 plots (lattice: xyplot, wireframe etc.). Everything works
> perfectly fine (thanks to all of you for the suggestions and ideas),
> but before I am able to plot (.png's in a for-loop), I have to start
> a X11 device. I was wondering if it is possible to start the X11
> device from the R console (as it is tedious to click the X11-button
> in the GUI). Searching through the web, I found the command "X11()",
> but that _only_ works, if the X11-button in the GUI was pressed
> before... otherwise, I get an error message that it wasn't possible
> to start the X11 device and I get an additional warning saying that
> the connection to the X11 display couldn't be opened.
>
> Does it work to start such an device from the console? If so, what's
> the command to use?

# Start X11 server on Mac OS X
if (Sys.info()[1] == "Darwin") {
    x11.app <- file.path("",
                         "Applications",
                         "Utilities",
                         "X11.app")
    system(paste("open", x11.app))
}

----------------------------------------------------------
SIGSIG -- signature too long (core dumped)



More information about the R-help mailing list