Re: [R] Getting eps into Word documents.

From: Robert Baer <rbaer_at_atsu.edu>
Date: Tue 04 Oct 2005 - 23:38:31 EST

> > On 03-Oct-05 Marc Schwartz (via MN) wrote:
> > > On Mon, 2005-10-03 at 16:31 -0300, Rolf Turner wrote:
> > >> A student in one of my courses has asked me about getting R graphics
> > >> output (under Linux) into a Word document. I.e. she wants to do her
> > >> R thing under Linux, but then do her word processing using Word.
--------------snip--------------
> > > So use something like the following:
> > >
> > >
> > > postscript("RPlot.eps", height = 4, width = 4,
> > > horizontal = FALSE, onefile = FALSE,
> > > paper = "special")
> > >
> > > plot(1:5)
> > >
> > > dev.off()
> > >
> > >
> > > You can then import the .eps file into Word or most other such
> > > applications that can import encapsulated postscript files.

-------------snip----------------

> > > More information is available from MS here:
> > >
> > > http://support.microsoft.com/?kbid=290362
> > >
> > > HTH,
> > >
> > > Marc Schwartz
----------snip-----------
> > b) It won't work anyway if printed to a non-PostScript printer.
>
> True, which is the case irrespective of Word/Windows. If you don't have
> a PS printer locally or accessible via network, you can always install a
> PS printer driver and print to a file, which can then be printed by a
> third party if required.
>

Well, as a lowly Windows and Office user, I most often right click on R grahics, cut to clipboard, and paste into Word. So one possiblility is for the student to install R on her own machine (Windows or Mac?).

But I just tried Marc's suggestion, and it looks VERY VIABLE to me. I generated the graph from his code snippet and used "Insert picture from file" in Word 2003 to place the graphic in a Word document. I then tried printing on both an HP 4100 TN laserjet and an HP 960c deskjet. The image printed perfectly on both printers with crisp lines and text that apprear to be vector-based not degraded bitmapped representations. Certainly worth the student trying.

HTH,
Rob Baer



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Tue Oct 04 23:42:28 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:40:35 EST