Re: [R] Using vectors of names in calls for functions

2009-03-05 Thread hadley wickham
Hi Pascal, You need the aes_string function: V1_P2_plot<-function(df, x, y, z) { ggplot(df, aes_string(x = x, y= y, fill = z)) + geom_tile() } j<-c("k", "l") i<-"m" m<-rnorm(25) vsim<-cbind(expand.grid(k=1:5, l=1:5*10), m) V1_P2_plot(df=vsim, x=j[1], y=j[2], z=i) Hadley On Thu, Mar 5, 2

[R] Using vectors of names in calls for functions

2009-03-05 Thread Pascal Boisson
Dear R people, it is a pleasure to try and use functionnalities that are in ggplot, even with my poor capacities in R. so far, i'dlike to be able to use these in my own function, and to "be able to use it repeatedly from vectors where I store the names of my columns." I have understood that this