title: How to fix 'Quosures can only be unquoted within a quasiquotation context' error in R function
body: <p>I am trying to write my first function using <code>rlang</code> and I am having some trouble fixing the following error.</p>
  
  <p>I've read the <a href="https://tidyeval.tidyverse.org" rel="nofollow noreferrer">vignette</a>, but didn't see a good example of what I'm trying to do.</p>
  
  <pre class="lang-r prettyprint-override"><code>library(babynames)
  library(tidyverse)
  
  name_graph &lt;- function(data, name, sex){
  name &lt;- enquo(name)
  sex &lt;- enquo(sex)
  
  data %&gt;%
    filter_(name == !!name, sex == !!sex) %&gt;%
    select(year, prop) %&gt;%
    ggplot()+
    geom_line(mapping = aes(year, prop))
  }
  
  name_graph(babynames, Robert, M)
  </code></pre>
  
  <p>I'm expecting my distribution graph, but getting an error: </p>
  
  <blockquote>
    <p>Called from: abort(paste_line("Quosures can only be unquoted within a 
    quasiquotation context.", 
       "", "  # Bad:", "  list(!!myquosure)", 
       "", "  # Good:", "  dplyr::mutate(data, !!myquosure)"))</p>
  </blockquote>