The R Project SVN R

Rev

Rev 68953 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 68953 Rev 80066
Line 19... Line 19...
19
local({
19
local({
20
    makeLazyLoadDB <- function(from, filebase, compress = TRUE, ascii = FALSE,
20
    makeLazyLoadDB <- function(from, filebase, compress = TRUE, ascii = FALSE,
21
                               variables) {
21
                               variables) {
22
 
22
 
23
        envlist <- function(e)
23
        envlist <- function(e)
24
            .Internal(getVarsFromFrame(ls(e, all = TRUE), e, FALSE))
24
            .Internal(getVarsFromFrame(ls(e, all.names = TRUE), e, FALSE))
25
 
25
 
26
        envtable <- function() {
26
        envtable <- function() {
27
            idx <- 0
27
            idx <- 0
28
            envs <- NULL
28
            envs <- NULL
29
            enames <- character(0)
29
            enames <- character(0)
Line 79... Line 79...
79
        }
79
        }
80
 
80
 
81
        if (is.environment(from)) {
81
        if (is.environment(from)) {
82
            if (! missing(variables))
82
            if (! missing(variables))
83
                vars <- variables
83
                vars <- variables
84
            else vars <- ls(from, all = TRUE)
84
            else vars <- ls(from, all.names = TRUE)
85
        }
85
        }
86
        else if (is.list(from)) {
86
        else if (is.list(from)) {
87
            vars <- names(from)
87
            vars <- names(from)
88
            if (length(vars) != length(from) || any(nchar(vars) == 0))
88
            if (length(vars) != length(from) || any(nchar(vars) == 0))
89
                stop("source list must have names for all elements")
89
                stop("source list must have names for all elements")
Line 100... Line 100...
100
        }
100
        }
101
 
101
 
102
        vals <- lapply(vars, get, envir = varenv, inherits = FALSE)
102
        vals <- lapply(vars, get, envir = varenv, inherits = FALSE)
103
        names(vals) <- vars
103
        names(vals) <- vars
104
 
104
 
105
        rvars <- ls(envenv, all = TRUE)
105
        rvars <- ls(envenv, all.names = TRUE)
106
        rvals <- lapply(rvars, get, envir = envenv, inherits = FALSE)
106
        rvals <- lapply(rvars, get, envir = envenv, inherits = FALSE)
107
        names(rvals) <- rvars
107
        names(rvals) <- rvars
108
 
108
 
109
        val <- list(variables = vals, references = rvals,
109
        val <- list(variables = vals, references = rvals,
110
                    compressed = compress)
110
                    compressed = compress)