Desktop Survival Guide
by Graham Williams
Installing the MS/Windows version of R on a GNU/Linux machine seems like a very odd thing to do, but there are times when you may need to share a high quality graphics file in a format that your MS/Windows limited colleagues can use. Only the MS/Windows version of R can generate MS/Windows Metafiles (with filename extension wmf and emf). As with many things in GNU/Linux, which is all about freedom, you can install the MS/Windows version of R using the GNU/Linux package called Wine. The steps are (replace http://cran.au.r-project.org/ with an archive near you--see http://cran.r-project.org/mirrors):
[language=csh,basicstyle=\ttfamily\tiny] $ wget http://cran.au.r-project.org/bin/windows/base/R-2.4.1-win32.exe $ wine R-2.3.1-win32.exe $ wine ~/.wine/fake_windows/Program\ Files/R/2.4.1/bin/Rgui.exe
The resulting window will be running the MS/Windows application on your GNU/Linux desktop.
Inside the Rgui you can create a MS/Windows Metafile image in this
> win.metafile("sample.emf") > plot(iris$Petal.Length, iris$Petal.Width) > dev.off()
But now we are ahead of ourselves! These three lines illustrate sentences that we write in order to command R to do things for us. The `>' is a prompt which indicates that R is waiting for our instructions. We type in what follows (e.g., plot) which instructs R to produce a plot. The information between the brackets tell R what to plot--they are the command arguments.
Copyright © 2004-2006 Graham.Williams@togaware.com Support further development through the purchase of the PDF version of the book.