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

Chuck Cleland ccleland at optonline.net
Fri May 30 02:19:10 CEST 2008


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(...)
>   dev.off()
> 
> (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:

?windows

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

locale:
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:

http://cran.r-project.org/bin/windows/base/rw-FAQ.html

> With thanks,
> Ted.

hope this helps,

Chuck

> --------------------------------------------------------------------
> E-Mail: (Ted Harding) <Ted.Harding at manchester.ac.uk>
> Fax-to-email: +44 (0)870 094 0861
> Date: 30-May-08                                       Time: 00:48:12
> ------------------------------ XFMail ------------------------------
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code. 

-- 
Chuck Cleland, Ph.D.
NDRI, Inc. (www.ndri.org)
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



More information about the R-help mailing list