depcache-package | R Documentation |
Hash an expression with its dependencies and store its value, reloading it from a file as long as both the expression and its dependencies stay the same.
The functions in this package take an expression, walk its code to find its dependencies and calculate a hash of them. If a corresponding file already exists, it is loaded; otherwise, the expression is evaluated and its value is saved in the file. Optionally, this check may be performed every time a variable is accessed.
By default, a subdirectory of the current directory is used to store the cache files.
Index: This package was not yet installed at build time.
Ivan Krylov
FNV-1a hash: http://www.isthe.com/chongo/tech/comp/fnv/
cache
, %<-%
a <- 1 # will evaluate expression cache({ message('evaluating expression'); a + 1 }) # 2 # will reuse cached value x %<-% { message('evaluating expression'); a + 1 } # 2 x a <- 2 # will recalculate the value x # 3
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.