title: match multiple column with row value from another frame based on date
body: <p>I have the below tables:</p>
  
  <pre><code>test&lt;- read.table(text = "        var1 var2 var3 var4
                    1 12/12/2017  CAD   10    3
                    2 20/02/2018  CAD   30    8
                    3 14/03/2016  USD   44    9
                    4 10/05/2000  KOR   56   11
                    5 04/04/2016  GBP   45   22")
  
  test2 &lt;- read.table(text = "        date USD CAD KOR GBP
  1 12/12/2017   1   2 0.1   2
  2 20/02/2018   2   1 0.8   1
  3 14/03/2016   3   4 1.0   4
  4 10/05/2000   4   5 0.6   5
  5 04/04/2016   5   1 1.0   1")
  </code></pre>
  
  <p>I want to multiply the values of <code>test$var3</code> and <code>test$var4</code> with the corresponding values in the <code>test2</code> table depending on the date. So for example if <code>test$var2</code> is CAD and <code>test$var1</code> is 12/12/2017, it should look into table <code>test2</code> to find the spot rate of CAD at that date and multiply it with <code>test$var3</code> and <code>test$var4</code>.</p>
  
  <p>Is there a way to do that?</p>