The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.

Title: Cache and Retrieve Computation Results
Version: 0.0.3
Description: Easily cache and retrieve computation results. The package works seamlessly across interactive R sessions, R scripts and Rmarkdown documents.
URL: https://github.com/OlivierBinette/cache
BugReports: https://github.com/OlivierBinette/cache/issues
License: MIT + file LICENSE
Imports: digest, assert, cli, here
Encoding: UTF-8
RoxygenNote: 7.1.1
NeedsCompilation: no
Packaged: 2022-03-26 21:32:13 UTC; olivier
Author: Olivier Binette [aut, cre]
Maintainer: Olivier Binette <olivier.binette@gmail.com>
Repository: CRAN
Date/Publication: 2022-03-26 22:00:02 UTC

Cache or Retrieve Computation Results

Description

Cache or retrieve an evaluated expression. Results are always made available in the current environment.

Usage

cache(..., .cachedir = here(".cache-R"), .rerun = FALSE)

Arguments

...

Named expressions to be cached or retrieved.

.cachedir

Directory where cache files are stored. Default is a directory called .cache-R located at the project root.

.rerun

Whether or not to clear the cache and re-run the provided expressions. Defaults to FALSE.

Examples

tmp <- tempdir()

# Takes 1 second to execute
cache(a = {
  Sys.sleep(1)
  "Hello World"
}, .cachedir = tmp)

# Executes instantly
cache(a = {
  Sys.sleep(1)
  "Hello World"
}, .cachedir = tmp)

# Result is available in the current environment
print(a)

# Re-run the expression
cache(a = {
  Sys.sleep(1)
  "Hello World"
}, .cachedir = tmp, .rerun = TRUE)

Load cached objects from cache directory

Description

Load cached objects from cache directory

Usage

cache_load(objnames = "*", .cachedir = here(".cache-R"))

Arguments

objnames

character list of object names to load.

.cachedir

path to cache directory. Defaults to the directory named .cache-R at the project root.

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.