R/g.data.attach.R

Defines functions g.data.attach

Documented in g.data.attach

## Attach (or virtually create) a delayed-data package ("DDP"):
g.data.attach <- function(dir, pos=2, warn=TRUE, readonly=FALSE) {
    env <- attach(NULL, pos, basename(dir))
    attr(env, "path")     <- dir
    attr(env, "readonly") <- readonly
    if (!file.exists(dir)) {if (warn) warning("New DDP: ", dir); return(invisible())}
    for (fn in dir(dir, pattern="\\.RData$", all.files=TRUE, full.names=TRUE))
      eval(substitute(delayedAssign(OB, get(load(FN))), list(OB=g.data.unmash(fn), FN=fn)), env)
}

Try the g.data package in your browser

Any scripts or data that you put into this service are public.

g.data documentation built on May 1, 2019, 8:50 p.m.