I ran into an interesting problem regarding how/when variables are evaluated in ggplot constructs.
The simplest example I can think of to reproduce this is the foll
The aes() specifically prevents evulation. If you want evaulation, you can use the standard-evaluation version aes_()
aes()
aes_()
panel=ggplot() + xlim(-1,11) + ylim(-1,11) for (i in c(1:10)) { panel=panel+geom_point(aes_(x=df$x[i],y=df$y[i])) } print(panel)