Description Usage Arguments Details Value Note Author(s)
View source: R/track.plugin.lru.R
Plugins for cache policies in the track package specify what objects should be keep in memory at the end of each top level command.
1 | track.plugin.lru(objs, inmem, envname)
|
objs |
: the full object summary dataframe. A subset of this data
frame is returned by |
inmem |
: a logical vector with length equal to the number of rows
in |
envname |
: a single string containing the name of the tracking
environment, in a form like |
track
contains an experimental feature that allows
users to supply their own plugin functions that specify
cache rules. Currently, the plugin function can specify
whether or not an object will be flushed from memory at the
end of a top-level command.
track.plugin.lru()
implements a simple least-recently-used discard policy.
To use is, supply it to track.options()
:
1 | track.options(cacheKeepFun=track.plugin.lru, save=TRUE)
|
Here is another example of a very simple cache plugin function: this one keeps in memory variables whose names begin with the letter 'x'.
1 2 3 4 5 |
To use this plugin function, supply it to track.options()
:
1 | track.options(cacheKeepFun=my.plugin, save=TRUE)
|
A plugin function must return a logical vector the same length as
inmem
, with TRUE
values where the corresponding objects
should be kept in memory.
To flush cached tracked objects from memory, use track.flush()
.
Tony Plate tplate@acm.org
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.