title: How to get all values of column A corresponding to certain value of column B in a data.frame?
body: <p>The follow is my data.</p>
  
  <pre><code>,x
  1,16239.2037182035
  2,2290.58697355612
  3,26661.4009577282
  5,3404.57199108078
  6,2017.05432741796
  7,1281.6543596914
  13,4856.59473014722
  17,1108.97190826966
  18,5292.00866901003
  </code></pre>
  
  <p><code>data&lt;-read.csv("test.csv",header=TRUE)</code></p>
  
  <pre><code>data
  
          X            x
  1       1 1.623920e+04
  2       2 2.290587e+03
  3       3 2.666140e+04
  4       5 3.404572e+03
  5       6 2.017054e+03
  6       7 1.281654e+03
  7      13 4.856595e+03
  8      17 1.108972e+03
  9      18 5.292009e+03
  </code></pre>
  
  <p>Now I want to get the x value when X=13, how to implement this?
  I know that data[7,]$x can get the x value. But I want to get the x value when X is a certain value. 
  Thanks.</p>