Return elements of list as independent objects in global environment

前端 未结 3 2028
名媛妹妹
名媛妹妹 2020-11-27 06:31

I have a list, and would like to break the elements of the list into seperate objects in the global environment.

For example, I would like the list:



        
3条回答
  •  情书的邮戳
    2020-11-27 06:59

    I don't recommend it but you could use attach

    > obj <- list(a=1:5, b=2:10, c=-5:5)
    > attach(obj)
    > a
    [1] 1 2 3 4 5
    > b
    [1]  2  3  4  5  6  7  8  9 10
    > c
     [1] -5 -4 -3 -2 -1  0  1  2  3  4  5
    

提交回复
热议问题