I am trying to output about 250 plots from an r-script and I'm receiving a "too many open devices" 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, t开发者_开发问答he method in which I'm dumping the plots?
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()
}
精彩评论