1
我想将现有数据框重命名为变量中的名称。任何想法都表示赞赏。动态重命名数据帧
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.
相关文章:http://stackoverflow.com/questions/22951811,http://stackoverflow.com/questions/2717757 – zx8754
我想通了。 eval(parse(text = paste(datasetname,“< - rtbl”))) –
“如果答案是parse(),你通常应该重新考虑这个问题。” - Thomas Lumley R-help(2005年2月)。此外,请参阅[具体是什么eval(parse(...))的危险?](http://stackoverflow.com/questions/13649979/what-specifically-are-the-dangers-of-evalparse) – zx8754