R/subClosure.R

Defines functions subClosure

subClosure <- function(closure, sub) {
    e <- environment(closure)
    restr <- new.env(parent = parent.env(e))
    for (ss in sub) {
        assign(ss, get(ss, envir = e), envir = restr)
    }
    environment(closure) <- restr
    return(closure)
}

Try the rrscale package in your browser

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

rrscale documentation built on May 2, 2019, 5:43 a.m.