title: Pass arguments to dplyr functions
body: <p>I want to parameterise the following computation using <code>dplyr</code> that finds which values of <code>Sepal.Length</code> are associated with more than one value of <code>Sepal.Width</code>:</p>
  
  <pre><code>library(dplyr)
  
  iris %&gt;%
      group_by(Sepal.Length) %&gt;%
      summarise(n.uniq=n_distinct(Sepal.Width)) %&gt;%
      filter(n.uniq &gt; 1)
  </code></pre>
  
  <p>Normally I would write something like this:</p>
  
  <pre><code>not.uniq.per.group &lt;- function(data, group.var, uniq.var) {
      iris %&gt;%
          group_by(group.var) %&gt;%
          summarise(n.uniq=n_distinct(uniq.var)) %&gt;%
          filter(n.uniq &gt; 1)
  }
  </code></pre>
  
  <p>However, this approach throws errors because <code>dplyr</code> uses <a href="http://adv-r.had.co.nz/Computing-on-the-language.html">non-standard evaluation</a>. How should this function be written?</p>