I\'m trying to save a ggplot within a function using graphics devices. But I found the code produces empty graphs. Below is a very very simple example.
libr
These plots have to be printed:
ff <- function(){ jpeg("a.jpg") p <- qplot(1:20, 1:20) print(p) dev.off() } ff()
This is a very common mistake.