[R] capturing a figure to PDF or Image

Sarah Goslee sarah.goslee at gmail.com
Tue Sep 6 15:45:12 CEST 2011


Eran,

> On Tue, Sep 6, 2011 at 8:53 AM, Eran Eidinger <eran at taykey.com> wrote:
>>
>> Thank you Sarah and David,
>> I only used a simple plot, and remembered to dev.off().
>> attached is the session:
>>
>> > plot(c(1,2,3),c(3,2,4))
>> > jpeg("test.jpg")
>> > dev.off()

So you plotted something to your default device, THEN opened a JPG
device, and closed with without plotting anything to it.

How about instead you try:

jpeg("test.jpg")
plot(c(1,2,3),c(3,2,4))
dev.off()

Open the device, plot something close it. Reading ?Devices might also be of use.

Sarah


--
Sarah Goslee
http://www.functionaldiversity.org



More information about the R-help mailing list