title: How do I match across large data sets using names, gender, race, and a rough estimate of age in R
body: <p>I have 2 data sets each around 20k rows.</p>
  <p>df 1 contains the following information</p>
  <p>first name | last name | race | sex | year of birth | unique ID</p>
  <p>df2 contains the following</p>
  <p>first name | last name | race | sex | age</p>
  <p>I would like to join the data sets so that I get a unique ID for each row relevant row in DF 2. The issue is since this data is longitudinal some people are in df2 several times and have multiple ages. for example</p>
  <pre><code>John | smith | white | male | 29
  John | smith | white | male | 30
  </code></pre>
  <p>whereas df1 contains the following</p>
  <pre><code>John | smith | white | male | 1991 | 74b23
  
  </code></pre>
  <p>ultimately I would like the data to look like this</p>
  <pre><code>
  John | smith | white | male | 29 | 74b23
  John | smith | white | male | 30 | 74b23
  </code></pre>
  <p>is there a way to return exact matches on the first name, last name, race, and gender but match on age give or take a year?</p>
  <p>Thanks!</p>