Run Once and Save Result

Package 'runonce' helps automating the saving of long-running code to help running the same code multiple times. If you run some long-running code once, it saves the result in a file on disk. Then, if the result already exists, i.e. if the code has already been run and its output has already been saved, it just reads the result from the stored file instead of running the code again.


R-CMD-check Codecov test coverage

runonce

Run once and save result. Then, just read the result.

Code example

tmp <- tempfile(fileext = ".rds")

save_run({
  Sys.sleep(2)
  1
}, file = tmp)

save_run({
  Sys.sleep(2)
  1
}, file = tmp)

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("runonce")

0.3.3 by Florian Privé, a year ago


https://github.com/privefl/runonce, https://privefl.github.io/runonce/


Report a bug at https://github.com/privefl/runonce/issues


Browse source code at https://github.com/cran/runonce


Authors: Florian Privé [aut, cre]


Documentation:   PDF Manual  


GPL-3 license


Imports bigassertr, urltools

Suggests testthat, covr


Imported by bigsnpr.


See at CRAN