title: Use of tidyeval based non-standard evaluation in recode in right-hand side of mutate
body: <p>Consider a tibble where each column is a character vector which can take many values -- let's say "A" through "F". </p>
  
  <pre><code>library(tidyverse)
  sample_df &lt;- tibble(q1 = c("A", "B", "C"), q2 = c("B", "B", "A"))
  </code></pre>
  
  <p>I wish to create a function which takes a column name as an argument, and recodes that column so that any answer "A" becomes an NA and the df is otherwise returned as is. The reason for designing it this way is to fit into a broader pipeline that performs a series of operations using a given column.</p>
  
  <p>There are many ways to do this. But I am interested in understanding what the best idiomatic tidy_eval/tidyverse approach would be. First, the question name needs to be on the left hand side of a mutate verb, so we use the <code>!!</code> and <code>:=</code> operators appropriately. But then, what to put on the right hand side?</p>
  
  <pre><code>fix_question &lt;- function(df, question) {
      df %&gt;% mutate(!!question := recode(... something goes here...))
  }
  
  fix_question(sample_df, "q1") # should produce a tibble whose first column is (NA, "B", "C")
  </code></pre>
  
  <p>My initial thought was that this would work:</p>
  
  <pre><code>df %&gt;% mutate(!!question := recode(!!question, "A" = NA_character_))
  </code></pre>
  
  <p>But of course the bang-bang on inside the function just returns the literal character string (e.g. "q1"). I ended up taking what feels like a hacky route to reference the data on the right hand side, using the base R <code>[[</code> operator and relying on the <code>.</code> construct from dplyr, and it works, so in a sense I have solved my underlying problem:</p>
  
  <pre><code>df %&gt;% mutate(!!question := recode(.[[question]], "A" = NA_character_))
  </code></pre>
  
  <p>I'm interested in getting feedback from people who are very good at tidyeval as to whether there is a more idiomatic way to do this, in hopes that seeing a worked example would enhance my understanding of the tidyeval function set more generally. Any thoughts?</p>