This function provides
LazyData functionality for packages
which do not provide it. It acts as an enhanced substitute for the
1 2 3
The name of the package whose attachment to the search path is required. May me a name or a literal character string.
The path to the library holding the package. As for
Logical: should the stanandard loading message be suppressed?
Logical: should the
Should objects masked by the attachment of the package be flagged?
Logical: should the
Additional arguments currently ignored.
The only function this package provides,
requireData, is a
substitute for the base function
require. If the package is
not already on the search path, it attaches it. In addition, if the
package a) has data sets and b) does NOT use the LazyData facility,
then an additonal entry is made on the search path. This is an
unlocked environment initially populated by ‘promises’
delayedAssign) to load a copy of the data set into
memory if and when it is needed.
This is done recursively for all packages attached to the search path via dependencies.
If the package appears on the search path as
p, then any exposed data set objects appear at postion
datasets:<pkg>. The package environment is
locked, but the datasets environment is not. If a data set object is
needed at any stage, it is brought silently into memory at position
p+1 on the search path.
Any further call to
requireData(<pkg>) will reinstate the
datasets as promises, thus potentially freeing memory.
The intended effect is to make data sets more conveniently available
to users, to make the use of the
data function largely
unnecessary, and to avoid cluttering the global environment with
copies of passive data set objects.
TRUE if the package was successfully attached and
1 2 3 4 5
requireData("mgcv") ## we assume has data sets but no LazyLoad .Search() ## show augmented search path ## > ls("datasets:mgcv") ## "columb" "columb.polys"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.