开发者

Error in jpeg(a_paste_function) : too many open devices

开发者 https://www.devze.com 2022-12-14 17:33 出处:网络
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?

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()
}
0

精彩评论

暂无评论...
验证码 换一张
取 消