title: Position in vector based on approximate matching
body: <p>I have the <strong>sorted</strong> vector</p>
  
  <pre><code>m&lt;-c(1.1, 3.2, 3.6, 4, 4.6, 4.6, 5.6, 5.7, 6.2, 8.9)
  </code></pre>
  
  <p>I want to find the position of a value based on approximate matching. If the value does not exist in the vector i would like the position of the immediately previous value</p>
  
  <p>for exact matching I would use </p>
  
  <pre><code>&gt; match(4,m)
  [1] 4
  </code></pre>
  
  <p>But if I do </p>
  
  <pre><code>&gt; match(6,m)
  [1] NA
  </code></pre>
  
  <p>What i would like to get in this example is <code>8</code> (the position of the immidiately previous value of 6 which is the position of 5.7 which is <strong>8</strong>)</p>
  
  <p>Thank you in advance</p>