R.cache (version 0.14.0)

saveCache: Saves data to file cache

Description

Saves data to file cache, which is unique for an optional key object.

Usage

# S3 method for default
saveCache(object, key=NULL, sources=NULL, suffix=".Rcache", comment=NULL, pathname=NULL,
  dirs=NULL, compress=NULL, ...)

Arguments

object

The object to be saved to file.

key

An optional object from which a hexadecimal hash code will be generated and appended to the filename.

sources

Source objects used for comparison of timestamps when cache is loaded later.

suffix

A character string to be appended to the end of the filename.

comment

An optional character string written in ASCII at the beginning of the file.

pathname

(Advanced) An optional character string specifying the pathname to the cache file. If not specified (default), a unique one is automatically generated from arguments key and suffix among other things.

dirs

A character vector constituting the path to the cache subdirectory (of the cache root directory as returned by getCacheRootPath()) to be used. If NULL, the path will be the cache root path.

compress

If TRUE, the cache file will be saved using gzip compression, otherwise not.

...

Additional argument passed to save().

Value

Returns (invisible) the pathname of the cache file.

Compression

The saveCache() method saves a compressed cache file (with filename extension *.gz) if argument compress is TRUE. The loadCache() method locates (via findCache()) and loads such cache files as well.

See Also

For more details on how the hash code is generated etc, loadCache().

Examples

Run this code
# NOT RUN {
For an example, see ?loadCache
# }

Run the code above in your browser using DataLab