This is not expected to be used by a user as it requires that the cacheId be calculated in exactly the same as it calculated inside Cache (which requires match.call to match arguments with their names, among other things).

saveToCache(
  cachePath = getOption("reproducible.cachePath"),
  drv = getDrv(getOption("reproducible.drv", NULL)),
  conn = getOption("reproducible.conn", NULL),
  obj,
  userTags,
  cacheId,
  linkToCacheId = NULL,
  verbose = getOption("reproducible.verbose")
)

Arguments

cachePath

A repository used for storing cached objects. This is optional if Cache is used inside a SpaDES module.

drv

if using a database backend, drv must be an object that inherits from DBIDriver e.g., from package RSQLite, e.g., SQLite

conn

an optional DBIConnection object, as returned by dbConnect().

obj

The R object to save to the cache

userTags

A character vector with descriptions of the Cache function call. These will be added to the Cache so that this entry in the Cache can be found using userTags e.g., via showCache().

cacheId

The hash string representing the result of .robustDigest

linkToCacheId

Optional. If a cacheId is provided here, then a file.link will be made to the file with that cacheId name in the cache repo. This is used when identical outputs exist in the cache. This will save disk space.

verbose

Numeric, -1 silent (where possible), 0 being very quiet, 1 showing more messaging, 2 being more messaging, etc. Default is 1. Above 3 will output much more information about the internals of Caching, which may help diagnose Caching challenges. Can set globally with an option, e.g., options('reproducible.verbose' = 0) to reduce to minimal

Value

This is used for its side effects, namely, it will add the object to the cache and cache database.