Categories
Coding R

Headless R / X11 and Cygwin/X

Running R on a Linux server in headless mode (i.e. producing graphics without XWindows running) can be tricky. Some people recommend using a virtual X framebuffer. However, I’ve found that the best approach (at least im my opinion) is to use the R interface to Cairo. This allows R to produce png graphics in headless mode, and also produces very nice looking graphs. I configured R as follows (after downloading and building pixman-0.15.18, and cairo-1.8.8:

./configure --with-gnu-ld --with-x --with-cairo

This will produce an R binary with cairo support that can be run non-interactively and produce graphical output – very useful for running automated statistical reports.

You can check that Cairo support is enabled by checking the return value of the capabilities() function:

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

Finally, some notes on connecting X11 clients using Cygwin (which I always forget how to do). On the server, check /etc/ssh/sshd_config for the line

X11Forwarding yes

And then run a local X server:

XWin -clipboard -emulate3buttons -multiwindow

Once this is running, from an xterm, run ssh, passing in the -X argument to enable X forwarding.

ssh -X -l username myserver

X11-based applications can then be run from this session.

Categories
Music

John Carpenter Themes

I have been playing with Lilypond a little more, and here are some themes that I have transcribed. They are all from John Carpenter movies: the first is the theme from “Halloween”, which is an interesting 5/4 time piano riff; the second is the synth theme from “Escape From New York”, and the final is the ending credits music of “The Thing” (known as “Humanity Part II” on the soundtrack album). The last one is a bit messy as I couldnt get Lilypond to hold the ties across multiple bars properly.

carpenter.pdf
carpenter.pdf

This is still not 100% finished – there are some omissions. Plus, my transcription may be incorrect in places.

Here is the PDF:

carpenter.pdf

And the Lilypond source:

carpenter

Categories
Coding

UseR 2009 Presentation and London R User Group News

Last week I presented a short talk at the 2009 UseR conference. The conference was the usual mix of varied topics (even more varied than usual this year) and a lot of interesting discussions.

Here are the slides.

Incidentally, Mango Solutions have set up a website for the London R user group meetings here: http://www.londonr.org/