Getting strings recognized as variable names in R
Related: Strings as variable references in R Possibly related: Concatenate expressions to subset a dataframe I've simplified the question per the comment request. Here goes with some example data. dat <- data.frame(num=1:10,sq=(1:10)^2,cu=(1:10)^3) set1 <- subset(dat,num>5) set2 <- subset(dat,num<=5) Now, I'd like to make a bubble plot from these. I have a more complicated data set with 3+ colors and complicated subsets, but I do something like this: symbols(set1$sq,set1$cu,circles=set1$num,bg="red") symbols(set2$sq,set2$cu,circles=set2$num,bg="blue",add=T) I'd like to do a for loop like this: