I have a list created like this:
x <- c("a", "b", "c")
, where
a,b,c are characters and a value.
I would like to create data.frames (with other operations or commands) that will be named based off of the list x. This will be a loop with lots of functions in it but the most important is that it can read the list as characters that then become the name of a data.frame in the next step.
Example: y is a dataframe that has a b and c listed as characters in a column called family
x <- c("a", "b", "c")
for (i in 1:length(x)) {
eval(as.name(i) <- y[which(y$family == "(eval(as.name(i))"),]
}
I have tried eval(as.name(i), I have tried cat(i), I have tried cat[[i]], I have tried paste, print, or just [[i]]. Suggestions?