R: copy/move one environment to another

前端 未结 7 2001
-上瘾入骨i
-上瘾入骨i 2020-12-14 02:01

I would like to ask if it is possible to copy/move all the objects of one environment to another, at once. For example:

f1 <- function() {
    print(v1)
          


        
7条回答
  •  失恋的感觉
    2020-12-14 02:48

    To do it:

    environment(f1) <- environment(f2) # It does not work
    

    Open the f1 environment and run do this:

    ls(load(f2))
    

提交回复
热议问题