tags:

views:

56

answers:

1

I am trying to output about 250 plots from an r-script and I'm receiving this error. Is there some setting that I can adjust to avoid this problem?

Here is an example of how I am creating the plots:

for(x in 250) { 

plots <- ggplot(data=dat, aes(x,y,lab=labels))
jpeg(a_paste_function)
print(plots)

}

One thing I notice is that, when I write.table, the files are ready right away, whereas I always have to close R for the jpegs to be "printed". Perhaps that is the real problem, the method in which I'm dumping the plots?

TIA!

+1  A: 

Adding dev.off() worked.

for(x in 250) { 

plots <- ggplot(data=dat, aes(x,y,lab=labels))
jpeg(a_paste_function)
print(plots)
dev.off()
}
Brandon Bertelsen