title: How does R dplyr decide precedence between comparison and "or" operators?
body: <p>The book <em>R for Data Science</em> <a href="http://r4ds.had.co.nz/transform.html#logical-operators" rel="nofollow noreferrer">gives this example</a></p>
  
  <pre><code>library(nycflights13)
  library(tidyverse)
  
  filter(flights, month == 11 | 12)
  </code></pre>
  
  <p>The result is that <code>dplyr</code> filters for all flights where month == 1, because "it finds all months that equal 11 | 12, an expression that evaluates to TRUE"</p>
  
  <p>Why does it do "11 | 12" first, then do the comparison? Shouldn't it first do "month == 11", then "or" that with 12, return a vector of all TRUE, and therefore return everything?</p>
  
  <p>Below shows R giving precedence to <code>==</code> over <code>|</code>:</p>
  
  <pre><code>&gt; 3 == 5 | 7
  
  [1] TRUE
  &gt; 3 == (5 | 7)
  
  [1] FALSE
  </code></pre>