cache: Cache method for simList class objects
Description
Because the simList
has an environment as one of its slots, the caching mechanism
of the archivist package does not work. Here, we make a slight tweak to the
cache
function. Specifically, we remove all elements that have an environment
as part of their attributes. This is generally functions that are loaded from the modules,
but also the .envir
slot in the simList
. Thus, only non-function objects are
used as part of the digest
call in the digest
package (used internally in
the cache
function).Usage
cache(cacheRepo = NULL, FUN, ..., notOlderThan = NULL)
## S3 method for class 'simList':
cache(cacheRepo = NULL, FUN, ..., notOlderThan = NULL)
Arguments
cacheRepo
An object repository used for storing cached objects.
FUN
A function to be called.
...
Arguments for function FUN
.
notOlderThan
Restore an artifact from database only if it was created after notOlderThan.