title: Matching date columns with unequal length in R
body: <p>I have data in the following format with 3 date columns</p>
  
  <pre><code>X &lt;- c(24/02/2016, 25/02/2016, 26/02/2016, 29/02/2016, 01/03/2016, 02/03/2016,  03/03/2016, 04/03/2016, 07/03/2016, 08/03/2016, 09/03/2016, 10/03/2016, 11/03/2016, 14/03/2016, 15/03/2016)
  Y &lt;- c(26/08/2014, 10/09/2014,24/09/2014, 09/10/2014, 24/02/2016, 09/03/2016, 24/03/2016, 11/04/2016, 26/04/2016)
  Z &lt;- c(15/08/2014,  29/08/2014, 15/09/2014, 30/09/2014, 12/02/2016, 29/02/2016, 15/03/2016, 31/03/2016, 15/04/2016)
  </code></pre>
  
  <p>the output i want is like below</p>
  
  <pre><code>X                     Output
  24/02/2016          12/02/2016
  25/02/2016             NA
  26/02/2016             NA
  29/02/2016             NA
  01/03/2016             NA
  02/03/2016             NA
  03/03/2016             NA
  04/03/2016             NA
  07/03/2016             NA
  08/03/2016             NA
  09/03/2016         29/02/2016
  10/03/2016             NA
  11/03/2016             NA
  14/03/2016             NA
  15/03/2016             NA
  </code></pre>
  
  <p>Basically the problem is wherever there is a match between X and Y, i need Z corresponding to X in a new column.
  I am not really good with R so not able to figure out how to come up with a solution. Any ideas ?</p>