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 Nov. 9, 2023, 5:06 p.m.