cacheit {nncc} | R Documentation |
Function to cache long operations
Description
Save results from code that takes a long time to execute to a .rds file if that file does not exist in the cache directory. If the file exists in the cache directory, that file will be loaded to memory without evaluating the code.
Usage
cacheit(name, code, dir, createdir = FALSE, clearcache = FALSE)
Arguments
name |
Name of the file to create without extension |
code |
Expression of the code to execute and cache |
dir |
Name of cache directory which should be placed in the working directory |
createdir |
Logical about whether to create the directory if it does not exist |
clearcache |
Logical about whether to recalculate the cached .rds file for this object |
Details
For more information, please refer to the vignette using
browseVignettes("nncc")
.
Value
Output of code, either freshly executed if the file does not exist or or clearcache is TRUE otherwise returns result from the cache file
[Package nncc version 2.0.0 Index]