title: Tidyverse, Rlang and tidyeval: Bang bang (!!) failing inside function, but it appears to work without quotation
body: <p>I am running a function on a long database (<em>full_database</em>) with two major groups where I need to perform various linear models on multiple subsets, per group.</p>
  
  <p>Then, I extract the R^2, the adjusted R^2 and the p.value into a dataframe where each row corresponds to a single comparison. Since there are 30 different cases, I have another tibble which lists all possibilities (<em>possibilities</em>) where the arguments for the function lie.</p>
  
  <p>The script for the original function is:</p>
  
  <pre><code>database_correlation &lt;-  function(id, group) {
  
      require(dplyr)
      require(tidyr)
      require(rlang)
  
      id_name &lt;- quo_name(id)
      id_var &lt;- enquo(id)
      group_name &lt;- quo_name(group)
      group_var &lt;- enquo(group)
  
      corr_db &lt;- full_database %&gt;%
        filter(numid==!!id_name) %&gt;%
        filter(major_group==!!group_name) %&gt;%
        droplevels()
  
      correlation &lt;- summary(lm(yvar~xvar, corr_db))
  
      id.x &lt;- as.character(!!id_var) #Gives out an error: "invalid argument type"
      group.x &lt;- as.character(!!group_var) #Gives out an error: "invalid argument type"
      r_squared &lt;- correlation$r.squared
      r_squared_adj &lt;- correlation$adj.r.squared
      p_value &lt;- correlation$coefficients[2,4]
  
      data.frame(id.x, group.x, r_squared, r_squared_adj, p_value, stringsAsFactors=FALSE)
    }
  </code></pre>
  
  <p>I then run the function with:</p>
  
  <pre><code>correlation_all &lt;- lapply(seq(nrow(possibilities)), function(index) {
      current &lt;- possibilities[index,]
      with(current, database_correlation(id, database))
    }) %&gt;%
      bind_rows()
  </code></pre>
  
  <p>I have commented the part where I get an error (id.x and group.x assignment) and I've tried multiple alternatives (I will use id.x as an example):</p>
  
  <ol>
  <li>id_var &lt;- enquo(id) &amp; id.x &lt;- print(!!id_var)</li>
  <li>id_var &lt;- sym(id) &amp; id.x &lt;- as.character(!!id_var)</li>
  <li>id_var &lt;- sym(id) &amp; id.x &lt;- print(!!id_var)</li>
  <li>No id_var &amp; id.x &lt;- !!id_name</li>
  <li><strong>No id_var &amp; id.x &lt;- id_name</strong></li>
  </ol>
  
  <p>The last option (in <strong>bold</strong>), works even though it has no unquotation and the same is true if I remove the bang bang (!!) when filtering the <em>full_database</em>, by using <em>filter(numid==id_name)</em> directly but I just can't understand why. By testing with TRUE and FALSE, R might be interpreting bang bang as double negation and, since it's expecting a boolean, it throws out an error.</p>
  
  <p>Thank you for your help!</p>