I'm trying to name dataframes in lists.
The lists are like d.list01
, d.list02
...
Suppose they contain two data.frame respectively, and trying to name them "A" and "B". I wrote a for-loop like...
name.vectro <- c("A", "B")
for (i in 1:8) {
temp <- paste0("d.list", sprintf("%02d", i))
names(eval(parse(text = temp))) <- name.vector
}
This returns an error:
> Error in names(temp) <- name.vector :
> target of assignment expands to non-language object
I tried some other ways such as...
names(as.name(parse(text = temp))) <- name.vector
But I got the same error as above. I don't quite understand what "non-language object" is. I googled some related words, but I couldn't find related documents.
Any suggestions?
Any advice would be appriciated!