title: Return index associated with x-value limits R
body: <p>I have a large data-frame and need to return the index range associated with a given value in the data-frame.</p>
  
  <p>A minimal example:</p>
  
  <pre><code>x = c(2:11)
  x
  [1]  2  3  4  5  6  7  8  9 10 11
  </code></pre>
  
  <p>How can I return the index of a given value in x? </p>
  
  <p>For example, how do I return the index value of the number 3 in x (the desired output would be 2)?</p>
  
  <p>Thanks for your help. </p>