CacheDigest | R Documentation |
Cache
usesThis can be used by a user to pre-test their arguments before running
Cache
, for example to determine whether there is a cached copy.
CacheDigest(
objsToDigest,
...,
algo = "xxhash64",
calledFrom = "CacheDigest",
.functionName = NULL,
quick = FALSE
)
objsToDigest |
A list of all the objects (e.g., arguments) to be digested |
... |
passed to |
algo |
The algorithms to be used; currently available choices are
|
calledFrom |
a Character string, length 1, with the function to compare with. Default is "Cache". All other values may not produce robust CacheDigest results. |
.functionName |
A an arbitrary character string that provides a name that is different
than the actual function name (e.g., "rnorm") which will be used for messaging. This
can be useful when the actual function is not helpful for a user, such as |
quick |
Logical or character. If |
A list of length 2 with the outputHash
, which is the digest
that Cache uses for cacheId
and also preDigest
, which is
the digest of each sub-element in objsToDigest
.
data.table::setDTthreads(2)
a <- Cache(rnorm, 1)
# like with Cache, user can pass function and args in a few ways
CacheDigest(rnorm(1)) # shows same cacheId as previous line
CacheDigest(rnorm, 1) # shows same cacheId as previous line
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.