cacheSweave {cacheSweave} | R Documentation |
Cache computations when using Sweave
cacheSweaveDriver()
Computations in Sweave documents can be cached by setting the option
cache=true
in the code check declaration. When this option is
set, objects that are created in the code chunk (either through
assignment or by side effects) are stored in a key-value database in
the directory specified by setCacheDir
.
The cacheSweaveDriver
function is used directly with
Sweave
and is passed as the driver
argument.
cacheSweaveDriver
also creates a "map file" which has the
extention ".map" which contains metadata for each of the code chunks
in a document. This map file can be used in conjunction with the
RRPM
package for creating reproducible research packages.
Nothing useful is returned.
Code chunks that have side effects that do not result in objects being created in the global environment (i.e. plotting or system interaction) should generally not be cached since the code will not be run upon reevaluation.
Roger D. Peng rpeng@jhsph.edu, with much code for
cacheSweaveDriver
copied from Sweave source by Friedrich Leisch
Sweave
and package RRPM