Re: [R] Help for R on Windows for non-Win-enabled!

From: Chuck Cleland <>
Date: Thu, 29 May 2008 20:19:10 -0400

On 5/29/2008 7:48 PM, Ted Harding wrote:
> Hi Folks,
> I need help with a query about R on Windows, specifically
> about graphics devices.
> I'm advising someone remotely (so it's all by email) who
> is running R on Windows, while I am not (Linux only).
> Things have reached the stage where saving graphics plots
> as Windows metafiles is looming.
> I've been told that the result of "?device" in Windows is
> as follows (which is different from what I get on Linux,
> which does not mention anything Windowsy):
> Description
> The following graphics devices are currently available:
> windows The graphics driver for Windows (on screen, to printer
> and to Windows metafile).
> postscript Writes PostScript graphics commands to a file
> [... etc.]
> So, presumably, the code to save a plot to a WMF could be
> somthing on the lines of
> windows(file="....",...)
> plot(...)
> (but I'm only guessing here).
> When I open the PDF of the R Reference Index, and search for
> "metafile" or "wmf", I get the response "0 documents with
> 0 instances". Also, searching on "windows(" draws a blank, and
> as far as I can see none of the many hits when simply searching
> on "windows" is relevant.
> In the R for Windows FAQ, I find only one reference to "metafile"
> which simply says:
> 5.2 I hear about some nifty features: please tell me about them!
> You have read the file README.R-2.7.0? There are file menus on
> the R console, pager and graphics windows. You can source and
> save from those menus, and copy the graphics to png, jpeg, bmp,
> postscript, PDF or metafile. There are right-click menus giving
> shortcuts to menu items, and optionally toolbars with buttons
> giving shortcuts to frequent operations.
> Saving to a metafile via a GUI is out of the question in this
> context, since several graphs are going to be produced within a loop.
> And, in the FAQ, "windows(" is mentioned only once, in connection
> with Japanese fonts!
> So I cannot find any information about using the windows()
> function to write a metafile.
> So how should it be done?"

win.metafile(filename = "", width = 7, height = 7, pointsize = 12,

              restoreConsole = TRUE)

## A series of plots written to a sequence of metafiles win.metafile("Rplot%02d.wmf", pointsize = 10)

   That was from the help page for Windows graphics devices, which you can get to on a windows system with simply:


 > sessionInfo()
R version 2.7.0 Patched (2008-05-24 r45774) i386-pc-mingw32

LC_COLLATE=English_United States.1252;LC_CTYPE=English_United States.1252;LC_MONETARY=English_United
States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252

attached base packages:
[1] stats graphics grDevices utils datasets methods base

> And. generally, where should one look for information about
> the peculiarities of running R on Windows?

   The R Windows FAQ seems like a good place to start:

> With thanks,
> Ted.

hope this helps,


> --------------------------------------------------------------------
> E-Mail: (Ted Harding) <>
> Fax-to-email: +44 (0)870 094 0861
> Date: 30-May-08 Time: 00:48:12
> ------------------------------ XFMail ------------------------------
> ______________________________________________
> mailing list
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained, reproducible code.

Chuck Cleland, Ph.D.
NDRI, Inc. (
71 West 23rd Street, 8th floor
New York, NY 10010
tel: (212) 845-4495 (Tu, Th)
tel: (732) 512-0171 (M, W, F)
fax: (917) 438-0894

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Fri 30 May 2008 - 00:23:44 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 30 May 2008 - 00:30:42 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive