title: How to filter/subset a data.frame using values from one of its column
body: <p>How can I "truncate" a data.frame based on the values in a single column?  For example, if I have this matrix</p>
  
  <pre><code>x &lt;- c(5,1,3,2,4)
  y &lt;- c(1,5,3,4,2)
  data &lt;- data.frame(x,y)
  </code></pre>
  
  <p>and I want all data for values greater than or equal to x, how would I do that?  I know that I can find the addresses of x-values using</p>
  
  <pre><code>addresses &lt;- which(x&gt;=2)
  </code></pre>
  
  <p>but I'm not sure how to use this to make a new matrix.  The following do not work:</p>
  
  <pre><code>data2 &lt;- data[x&gt;=2]
  data2 &lt;- data[which(x&gt;=2)]
  </code></pre>
  
  <p>If anyone can offer any advice, I'd really appreciate it.</p>