[R-SIG-Mac] Difficulties with quartz() device and clipboard?

Steve Revilak steve at srevilak.net
Thu Oct 23 00:46:58 CEST 2008


> Date: Wed, 22 Oct 2008 14:41:07 -0700
> From: Robert Chatfield <Robert.B.Chatfield at nasa.gov>
> To: r-sig-mac at stat.math.ethz.ch
> Subject: [R-SIG-Mac] Difficulties with quartz() device and clipboard?
> 
> I have difficulties with the R-GUI or the R Quartz Window,
>
> At one time it was easy to copy to the clipboard and then paste into
> another document, e.g. Microsoft Word or GraphicConverter or ...
> No more.  There is a "Copy" item available (in dark letters, not greyed)
> in the Edit menu, but nothing goes into clipboard. I can verify this
> with
> several applications that have a "Show Clipboard" menu item.
> This was great for recording results of exploratory sessions without
> a generating a large number of files.

This might have something to do with what Word is willing to accept.
With Mac OS 10.5.5, R 2.7.2, GUI 1.25 (5217), I can say

   plot(1:10, 1:10, type="l")

R opens a quartz window and displays the line plot.  From there I can
copy the plot to the clipboard (via Cmd-C or Edit > Copy); after the
copy, I'll switch to Preview.app and press Cmd-N ("New from
clipboard") within Preview; Preview creates a new pdf document with
the plot.

Perhaps word doesn't handle pasting of pdf data?


> Items saved by quartz.save do not seem to open correctly in Preview
> or Acrobat.  I assume that one must close the Quartz device with
> dev.off()  Maybe I just need an example of quartz.save in action.)

   plot(1:10, 1:10, type="l")
   quartz.save("foo.png");
   quartz.save("foo.pdf", type="pdf");

After running these three commands, you should have a pdf named
"foo.pdf" and a png named "foo.png".

HTH.

Steve



More information about the R-SIG-Mac mailing list