Learn R Programming

reproducible (version 1.1.1)

writeFuture: Write to cache repository, using future::future

Description

This will be used internally if options("reproducible.futurePlan" = TRUE). This is still experimental.

Usage

writeFuture(
  written,
  outputToSave,
  cacheRepo,
  userTags,
  drv = getOption("reproducible.drv", RSQLite::SQLite()),
  conn = getOption("reproducible.conn", NULL),
  cacheId
)

Arguments

written

Integer. If zero or positive then it needs to be written still. Should be 0 to start.

outputToSave

The R object to save to repository

cacheRepo

The file path of the repository

userTags

Character string of tags to attach to this outputToSave in the CacheRepo

drv

an object that inherits from '>DBIDriver, or an existing '>DBIConnection object (in order to clone an existing connection).

conn

A '>DBIConnection object, as returned by dbConnect().

cacheId

Character string. If passed, this will override the calculated hash of the inputs, and return the result from this cacheId in the cacheRepo. Setting this is equivalent to manually saving the output of this function, i.e., the object will be on disk, and will be recovered in subsequent This may help in some particularly finicky situations where Cache is not correctly detecting unchanged inputs. This will guarantee the object will be identical each time; this may be useful in operational code.