| rspde.cache | R Documentation |
The mesh-free weighted-L2 tables are shipped with the package,
but a table for a particular spectral interval (see rspde.wl2.table() and
the kappa_ref argument of matern.operators()) has to be computed, which
takes of the order of a second. Within a session such tables are cached in
memory. Enabling this cache stores them on disk as well, so that a second
session, or a script run again, finds them instead of refitting.
The cache is off by default: a package should not write outside the session
temporary directory unless asked to. Calling rspde.cache(TRUE) is that
request, and creates the directory. The environment variable
RSPDE_CACHE_DIR sets it for non-interactive use, for instance from
.Renviron.
Cached files are organised by package version, so upgrading the package does not read tables produced by an older fit. Within a development version, clear the cache after changing anything that affects the coefficients.
rspde.cache(dir, clear = FALSE)
dir |
|
clear |
Delete the tables that are currently stored? |
The cache directory, or NULL if the cache is off, invisibly when
called for its effect.
rspde.wl2.table(), matern.operators()
rspde.cache()
## Not run:
rspde.cache(TRUE) # store generated tables between sessions
rspde.cache(clear = TRUE) # throw away what is stored
rspde.cache(FALSE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.