Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

setup.mcache

Cacheing objects for lazy-load access


Description

Manually setup existing reference objects– rarely used explicitly.

Usage

setup.mcache( envir, fpath, refs)

Arguments

envir

environment or position on the search path.

fpath

directory where "obj*.rda" files live.

refs

which objects to handle– all names in the mcache attribute of envir, by default

Details

Creates an active binding in envir for each element in refs. The active binding for an object myobj will be a function which keeps the real data in its own environment, reading and writing it as required. Writing a new value will give attr( envir, "mcache")[ "myobj"] a negative sign. This signals that the "obj*.rda" file needs updating, and the next Save (or move or cd) command will do so. [The "*" is the absolute value of attr( envir, "mcache")[ "myobj"].] One wrinkle is that the "real data" is initially a promise created by delayedAssign, which will fetch the data from disk the first time it is needed.

Author(s)

Mark Bravington

See Also

mlazy, makeActiveBinding, delayedAssign


mvbutils

Workspace Organization, Code and Documentation Editing, Package Prep and Editing, Etc

v2.8.232
GPL (>= 2)
Authors
Mark V. Bravington <mark.bravington@csiro.au>
Initial release
2018-12-11

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.