It would be convenient, but to work generally it would require an
infrastructure within ggplot2 for performing any kind of data
manipulation that you can imagine. I don't think that this is a good
idea in general, so I recommend performing your manipulations outside
of ggplot2. The plyr package is a natural fit for this sort of
activity:
cors <- ddply(mydf, c("group", "trt"), summarise, cor = cor(x, y))
Hadley
thanks for your reply - that seems convenient enough! ;-)
I haven't delved into the plyr-package so far, maybe I should do now ...
Best,
Felix