R get() function error

后端 未结 2 654
情书的邮戳
情书的邮戳 2021-01-19 16:12

I\'m trying to populate a set of matrices where the matrix (object) names are held in a list. I can use the get() to return the object with the given name, but I\'m running

2条回答
  •  无人共我
    2021-01-19 16:36

    Use function assign instead of get:

    assign(list.names[1],c(1,2,3,4))
    

    get returns an object's value, assign assigns. :)

    Same thing with eval, it just evaluates your call.

提交回复
热议问题