saveCache: Saves data to file cache

saveCacheR Documentation

Saves data to file cache

Description

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

Usage

## Default S3 method:
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.

Author(s)

Henrik Bengtsson

See Also

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

Examples

## Not run: For an example, see ?loadCache

R.cache documentation built on July 21, 2022, 5:11 p.m.