Displaying 1 result from an estimated 1 matches for "364698".
Did you mean:
36468
2011 Jul 13
1
dev.off and Cairo and ggplot2
I have a weird example which fails and I don't understand why. If I
put dev.off() inside my function, it produces a bad image file. But
if I run what I think should be equivalent code with dev.off() running
outside my function, it works. Why does the location of dev.off
matter?
library(Cairo)
library(ggplot2)
foo<-function(){
Cairo(file="a.png")
cat(dev.cur(),