Getting strings recognized as variable names in R

后端 未结 6 1762
我在风中等你
我在风中等你 2020-11-28 18:39

Related: Strings as variable references in R
Possibly related: Concatenate expressions to subset a dataframe


I\'ve simplified the question per the comment

6条回答
  •  無奈伤痛
    2020-11-28 19:08

    You found one answer, i.e. eval(parse()) . You can also investigate do.call() which is often simpler to implement. Keep in mind the useful as.name() tool as well, for converting strings to variable names.

提交回复
热议问题