R.cache-package | R Documentation |
Memoization can be used to speed up repetitive and computational expensive function calls. The first time a function that implements memoization is called the results are stored in a cache memory. The next time the function is called with the same set of parameters, the results are momentarily retrieved from the cache avoiding repeating the calculations. With this package, any R object can be cached in a key-value storage where the key can be an arbitrary set of R objects. The cache memory is persistent (on the file system).
To install this package and all of its dependent packages, do:
install.packages("R.cache")
loadCache, saveCache Methods for loading and saving objects from and to the cache.
getCacheRootPath, setCacheRootPath Methods for getting and setting the directory where cache files are stored.
Whenever using this package, please cite [1] as
Bengtsson, H. The R.oo package - Object-Oriented Programming with References Using Standard R Code, Proceedings of the 3rd International Workshop on Distributed Statistical Computing (DSC 2003), ISSN 1609-395X, Hornik, K.; Leisch, F. & Zeileis, A. (ed.), 2003
Here is a list of features that would be useful, but which I have too little time to add myself. Contributions are appreciated.
Add a functionality to identify cache files that are no longer of use. For now, there is an extra header field for arbitrary comments which can be used, but maybe more formal fields are useful, e.g. keywords, user, etc?
If you consider implement some of the above, make sure it is not already implemented by downloading the latest "devel" version!
See also the filehash package, and the cache()
function
in the Biobase package of Bioconductor.
The releases of this package is licensed under LGPL version 2.1 or newer.
[1] H. Bengtsson, The R.oo package - Object-Oriented Programming with References Using Standard R Code, In Kurt Hornik, Friedrich Leisch and Achim Zeileis, editors, Proceedings of the 3rd International Workshop on Distributed Statistical Computing (DSC 2003), March 20-22, Vienna, Austria. https://www.r-project.org/conferences/DSC-2003/Proceedings/
Henrik Bengtsson
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.