R/env.copy.R

Defines functions env.copy

Documented in env.copy

#[export]
env.copy<-function(x,all.names=FALSE){
    y<-new.env()
    all.vars<-ls(x,all.names = all.names)
    for(var in all.vars){
        val<-x[[var]]
        y[[var]] <- if(is.environment(val)) env.copy(val,all.names) else x[[var]]
    }
    y
}

Try the Rfast package in your browser

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

Rfast documentation built on March 18, 2022, 7:41 p.m.