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.
cacheit(name, code, dir, createdir = FALSE, clearcache = FALSE)Output of code, either freshly executed if the file does not exist or or clearcache is TRUE otherwise returns result from the cache file
Name of the file to create without extension
Expression of the code to execute and cache
Name of cache directory which should be placed in the working directory
Logical about whether to create the directory if it does not exist
Logical about whether to recalculate the cached .rds file for this object
For more information, please refer to the vignette using
browseVignettes("nncc").