title: How to use a variable in dplyr::filter?
body: <p>I have a variable with the same name as a column in a dataframe:</p>
  
  <pre><code>df &lt;- data.frame(a=c(1,2,3), b=c(4,5,6))
  b &lt;- 5
  </code></pre>
  
  <p>I want to get the rows where <code>df$b == b</code>, but dplyr interprets this as <code>df$b == df$b</code>:</p>
  
  <pre><code>df %&gt;% filter(b == b) # interpreted as df$b == df$b
  #   a b
  # 1 1 4
  # 2 2 5
  # 3 3 6
  </code></pre>
  
  <p>If I change the variable name, it works:</p>
  
  <pre><code>B &lt;- 5
  df %&gt;% filter(b == B) # interpreted as df$b == B
  #   a b
  # 1 2 5
  </code></pre>
  
  <p>I'm wondering if there is a better way to tell <code>filter</code> that <code>b</code> refers to an outside variable.</p>