【发布时间】:2016-06-21 09:48:44
【问题描述】:
我想将现有数据框重命名为变量中的名称。任何想法都表示赞赏。
rtbl <- load("clarktestjunk.RData")
datasetname = "specialdata" # passed in by the user
rename(rtbl,datasetname) # this is not the correct command
specialdata # this is how I want to reference the data set down stream.
【问题讨论】:
-
我想通了。 eval(parse(text=paste(datasetname,"
-
"如果答案是 parse(),你通常应该重新考虑这个问题。" ——Thomas Lumley R-help(2005 年 2 月)。另请参阅What specifically are the dangers of eval(parse(…))?