[Rd] [FORGED] recordPlot/replayPlot not working with saveRDS/readRDS

Winston Chang winstonchang1 at gmail.com
Tue Apr 3 20:17:11 CEST 2018


On Mon, Apr 2, 2018 at 4:41 PM, Paul Murrell <paul at stat.auckland.ac.nz> wrote:
> Hi
>
> What you are doing "wrong" is loading a recordedplot into the same session
> that it was created in.  The saveRDS()/readRDS() works if you save in one R
> session and then read in a different R session.  The assumption is that if
> you are still in the same session that created the recordedplot you still
> have the recordedplot (e.g., you can just do replayPlot(r) instead of
> replayPlot(r2).  Is that a bad assumption ?
>
> Paul

For my particular case, the goal is to cache many plots to disk so
that they can be replayed later, but still in the same R session. The
plots may be replayed in the current session, and they may be replayed
in a future one. Using a disk cache seems like a straightforward way
to make the cached plots work for both cases. Also, the number of
plots is such that a memory-based cache could consume significant
amounts of memory.

-Winston



More information about the R-devel mailing list