I am looking for a way to call different variables dynamically.
Like, if I've got variables a1, a2, and a3 in a for loop, and I want to use a different one each time. Something like:
a1 = "Good Morning"
a2 = "Good Afternoon"
a3 = "Good Night"
for (i in 1:3){
paste("a" & i)
}
That paste line doesn't work, and that's what I'm looking for. A way to combine "a" and i so it reads as the variable a1, then a2, then a3.