title: how to filter data frame with conditions of two columns?
body: <p>I am trying to select from a data frame.  The question is why I the last query below returns all 5 records not jsut the first two?</p>
  
  <pre><code>&gt; x &lt;- c(5,1,3,2,4)
  &gt; y &lt;- c(1,5,3,4,2)
  &gt; data &lt;- data.frame(x,y)
  &gt; data
    x y
  1 5 1
  2 1 5
  3 3 3
  4 2 4
  5 4 2
  &gt; data[data$x &gt; 4 || data$y &gt; 4]
    x y
  1 5 1
  2 1 5
  3 3 3
  4 2 4
  5 4 2
  </code></pre>