title: passing parameters to ggplot
body: <p>would like to create a function that generates graphs using ggplot. For the sake of simplicity, the typical graph may be</p>
  
  <pre><code>ggplot(car, aes(x=speed, y=dist)) + geom_point() 
  </code></pre>
  
  <p>The function I would like to create is of the type</p>
  
  <pre><code>f &lt;- function(DS, x, y) ggplot(DS, aes(x=x, y=y)) + geom_point()
  </code></pre>
  
  <p>This however won't work, since x and y are not strings. This problem has been noted in previous SO questions (e.g., <a href="https://stackoverflow.com/questions/5106782/use-of-ggplot-within-another-function-in-r">this one</a>), but without providing, in my view, a satisfactory answer. How would one modify the function above to make it work with arbitrary data frames?</p>