title: Programming with dplyr; quo, enquo, !!, etc
body: <p>I'm getting strange errors while trying to use dplyr with functions. I'm following the "<a href="http://dplyr.tidyverse.org/articles/programming.html" rel="nofollow noreferrer">Programming with dplyr</a>" guide but I'm seeing strange errors. This is the example code I am basing my own program off of:</p>
  
  <pre><code>library(tidyverse)
  
  df &lt;- tibble(
    g1 = c(1, 1, 2, 2, 2),
    g2 = c(1, 2, 1, 2, 1),
    a = sample(5), 
    b = sample(5)
  )
  
  
  my_summarise &lt;- function(df, group_var) {
    df %&gt;%
      group_by(!!group_var) %&gt;%
      summarise(a = mean(a))
  }
  
  my_summarise(df, quo(g1))
  </code></pre>
  
  <p>The example code should return</p>
  
  <pre><code>#&gt; # A tibble: 2 x 2
  #&gt;      g1        a
  #&gt;   &lt;dbl&gt;    &lt;dbl&gt;
  #&gt; 1     1 2.500000
  #&gt; 2     2 3.333333
  </code></pre>
  
  <p>But instead returns </p>
  
  <pre><code>Error: invalid argument type
  Called from: mutate_impl(.data, dots)
  </code></pre>
  
  <p>Is there something wrong or a package I'm missing? I also observe this error when I follow the linked guide's later directions and call <code>my_summarise(df, g1)</code> instead, using <code>enquo(group_var)</code> inside the function. </p>
  
  <p><strong>EDIT: Error occurs on older versions of dplyr. Above does not throw error for dplyr 0.7.4</strong></p>