最佳答案
见下文:
paste("perf.a", "1", sep="")
# [1] "perf.a1"
如果我想给 perf.a1
赋一个值怎么办?
我试了 as.name
、 as.symbol
等等,都没有用:
as.name(paste("perf.a", "1", sep="")) = 5
# Error in as.name(paste("perf.a", "1", sep = "")) = 5 :
# target of assignment expands to non-language object
as.symbol(paste("perf.a", "1", sep="")) = 5
# Error in as.symbol(paste("perf.a", "1", sep = "")) = 5 :
# target of assignment expands to non-language object
noquote(paste("perf.a", "1", sep="")) = 5
# Error in noquote(paste("perf.a", "1", sep = "")) = 5 :
# target of assignment expands to non-language object