Last data update: 2014.03.03

R: A LazyData Facility
lazyData-packageR Documentation

A LazyData Facility

Description

Supplies a LazyData facility for packages which have data sets but do not provide LazyData. A single function is is included, requireData, which is a drop-in replacement for base::require, but carrying the additional functionality.

Details

Package: lazyData
Type: Package
Version: 1.0.3
Date: 2014-01-30
License: GPL-2

If a package is attached with requireData, a check is made to see if a) the package provides data and b) if the data sets are not made visible to the user via LazyData. If both are the case, the package is attached to the search path, and in addition a second entry to the search path is made immediately behind the package containing promises to load the data sets should they be needed. This keeps data sets out of the global environment (unless they are modified), making them visible without occupying memory (unless they are needed).

Using requireData a second time on the same package has the effect of flushing any data sets brought into memory and reinstating them as promises.

Author(s)

Bill Venables

Maintainer: Bill Venables <bill.venables@gmail.com>

References

None.

See Also

require, library, data delayedAssign

Examples


requireData("mgcv") ## we assume has data sets but no LazyLoad
.Search()           ## show augmented search path

## > ls("datasets:mgcv")
##[1] "columb"       "columb.polys"

Results