2
可能重複:
how to get value when a variable name is passed as a string訪問變量剛剛創建
所以我使用了分配()創建一個變量
nam <- "act01"
assign(nam, read.table(text.txt, sep = ", ", header = T))
我試圖追加剛剛創建到另一個列表
的act01變量3210acts = list()
acts[[1]] <- nam # something wrong here, I can't find a way to retrieve the variable
是否有讓您將字符串轉換成R中變量的任何功能?
非常感謝
[FAQ 7.21](http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-can-I-turn-a-string-into-a-variable_003f) –
@ JoshuaUlrich非常感謝,我一直在努力。 – lusketeer