In R, how to get an object's name after it is sent to a function?

前端 未结 3 638
傲寒
傲寒 2020-11-22 09:37

I am looking for the reverse of get().

Given an object name, I wish to have the character string representing that object extracted directly from the ob

3条回答
  •  暖寄归人
    2020-11-22 10:33

    deparse(quote(var))
    

    My intuitive understanding In which the quote freeze the var or expression from evaluation and the deparse function which is the inverse of parse function makes that freezed symbol back to String

提交回复
热议问题