title: Merge data based on nearest date R
body: <p>How do I jeft.join 2 data frames based on the nearest date? I currently have the script written so that it joins by the exact date, but I would prefer to do it by nearest date in case there is not an exact match. </p>
  
  <p>This is what I currently have: </p>
  
  <pre><code>MASTER_DATABASE &lt;- left_join(ptnamesMID, CTDB, by = c("LAST_NAME", "FIRST_NAME", "Measure_date" = "VISIT_DATE"))
  </code></pre>