copyEnv               package:Biobase               R Documentation

_F_u_n_c_t_i_o_n_a_l_i_t_y _t_o _c_o_p_y _e_n_v_i_r_o_n_m_e_n_t_s

_D_e_s_c_r_i_p_t_i_o_n:

     These functions can be used to make copies of environments, or to
     get/assign all of the objects inside of an environment

_U_s_a_g_e:

     copyEnv(oldEnv, newEnv = new.env(parent = parent.env(oldEnv)), recurse = FALSE)
     env2list(envir, recurse=FALSE)
     list2env(vals, envir, recurse=FALSE)

_A_r_g_u_m_e_n_t_s:

  oldEnv: An environment to copy from

  newEnv: An environment to copy to.  Default is a new environment with
          the same parent environment as oldEnv.

   envir: An environment to get/set values to

    vals: A named list of objects to assign into an environment

 recurse: Whether to recurse upwards through the environment hierarchy

_D_e_t_a_i_l_s:

     'env2list':  This function will retrieve the objects from an
     environment and return them in a named list (names being the names
     of the objects). 'list2env':  This function will take a named list
     and assign all of its elements into the environment (using the
     names to name the objects). 'copyEnv':  This function will make a
     copy of the contents from 'oldEnv' and place them into 'newEnv'.

_A_u_t_h_o_r(_s):

     Jeff Gentry

_S_e_e _A_l_s_o:

     'environment'

_E_x_a_m_p_l_e_s:

        z <- new.env()
        multiassign(c("a","b","c"),c(1,2,3),z)

        a <- copyEnv(z)
        ls(a)

        q <- env2list(z)
        g <- new.env()
        g <- list2env(q,g)   
        ls(g)

