I am looking for a way to save a plot (graphics contents) to a file after the
plot has been calculated but before it has been rendered. More specifically,
assume that I made a plot that took a very long time to produce, I would
like to save this plot to a generic file that I can later, on a different
machine, render to either PDF, PNG, SVG using the usual R graphics devices,
without recalculating the graphical contents.

As a toy example, suppose this is my plot function:

testplot <- function(){
  Sys.sleep(10); #very long and complicated procedure
  plot(cars);
}

So the use case is that after running testplot() which took potentially 30
days to calculate, I would like to send a file to my colleagues that they
can load in R and send to their png or pdf or svg devices just as if they
would have made the plot themselves, without having to re-run the code.


--
View this message in context: 
http://r.789695.n4.nabble.com/Save-generic-plot-to-file-before-rendering-to-device-tp3659999p3659999.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to