title: get nearest data from dataframe in R
body: <p>I have a dataframe looks like:</p>
  
  <pre><code>date   accumulated_visits
  01-01    102
  01-02    134
  01-03    148
  01-04    159
  01-05    162
  01-06    175
  </code></pre>
  
  <p>I want a function, which could find the nearest entry, given a specific visit number. For example, I want to find the date when accumulated visits reaches closing to 150. I expect return </p>
  
  <pre><code>01-03  148 
  </code></pre>
  
  <p>Is there a buildin function to handle that?</p>