I need to store a plot object in a variable. I know that I can do:
plot(rnorm(10))
obj = recordPlot()
replayPlot(obj)
But I don't want to show the graphic window. So I'm trying to do this, but with no success until now.
win.metafile()
plot(rnorm(10))
obj = recordPlot()
dev.off()
replayPlot(obj) # it shows a null plot
Well, probably because when I'm doing obj = recordPlot()
the plot isn't ready yet.