depcache.options {depcache} | R Documentation |
Caching options
Description
Control how the dependencies are gathered and hashed to locate the determine the file name to load the cached object from.
Usage
depcache.options(
defaults = getOption("depcache.version", '0.1'),
skip = getOption("depcache.skip", NULL),
dir, compress, local.only, format.version
)
Arguments
defaults |
A string containing the version of depcache to get other
defaults from. If not set, takes the value from the
To make the caching more reproducible against package updates, call
Currently, only version |
skip |
A character vector of variables to omit from automatically-gathered dependencies. Variables carrying unintended or unimportant state, which would otherwise interfere with obtaining a reproducible hash, should be listed here. This may be useful when a symbol encountered in the expression doesn't signify a variable in the evaluation frame (e.g. non-standard evaluation when plotting with lattice), or when the variable is being assigned to as part of the expression. Defaults to the |
dir |
The directory to store the cache files inside. Defaults to the
|
compress |
Passed as the |
local.only |
If Defaults to the |
format.version |
Passed as the |
Details
In all cases, explicitly passed arguments override settings from the
options()
, which override the defaults. Depending on the
defaults
argument or the depcache.version
option, the
defaults may change; setting it explicitly will help your scripts stay
forward-compatible.
This function shouldn't be normally called by the user (except,
perhaps, to verify the parameters about to be passed to the caching
functions), but it is automatically invoked on every call to
cache
, setCached
, or the use of
cache-tracking assignment operators %<-%
and
%->%
. Any additional options passed to the functions
as ...
are handled here, and so are the global
options
.
Value
A list containing the settings to be used by the caching system.
dir |
The directory used for storage of the cache files. |
compress |
Passed to |
skip |
Variables to skip when hashing the dependencies of the expressions. |
local.only |
Whether to ignore non-local dependencies. |
format.version |
Passed to |
See Also
Examples
# The output is affected by the user's use of options(...) and the
# current version of the package
options(depcache.local.only = FALSE)
print(depcache.options(format.version = 3))
options(depcache.local.only = TRUE)
print(depcache.options())
# "skip" makes it possible to avoid mistaking arguments evaluated in a
# non-standard way for local variables
speed <- 1
options(depcache.skip = 'speed')
x %<-% { message('fitting the model'); lm(dist ~ speed, cars) }
speed <- 0
# not fitted again despite change in local variable "speed"
summary(x)