title: Mutate column based on another data frame with multiple matches
body: <p>I have the following data frames</p>
  
  <p>df1</p>
  
  <pre><code>ID    PMT_DATE
  100   2015/01/01
  100   2015/02/01
  100   2015/04/01 
  200   2016/01/01
  200   2016/02/01
  </code></pre>
  
  <p>and df2</p>
  
  <pre><code>ID    DATE         STATUS    
  100   2014/12/31   A
  100   2015/03/15   B
  200   2015/12/31   A  
  200   2016/06/01   C
  </code></pre>
  
  <p>I would create a data frame which is df1 with the STATUS column from df2. If the PMT_DATE column in df1 is greater than or equal to the DATE column in df2, the associated status in df2 should be placed in the new data frame. The resulting dataframe should look like this </p>
  
  <pre><code>ID    PMT_DATE     STATUS
  100   2015/01/01   A
  100   2015/02/01   A
  100   2015/04/01   B 
  200   2016/01/01   A
  200   2016/02/01   A
  </code></pre>
  
  <p>Normally I would join the two tables, create a new column and perform calculations with mutate and get rid of the columns I don't need anymore, but since there are multiple matches in the ID column in df1 and df2, I can't quite implement that strategy.</p>
  
  <p>EDIT: For multiple matches, I want the latest status. For instance, the last row with ID == 100 would fall under both Status == A and Status == B, but I only want status B. Also, the ID field in both dataframes represents the same thing (i.e. a join by ID is what I want). </p>
  
  <p>I was thinking of something along the lines of </p>
  
  <pre><code>new_df &lt;- df1 %&gt;% rowwise() $&gt;% do() ...
  </code></pre>
  
  <p>But I am not sure how to fill in the rest to achieve what I need. </p>