title: How to check if the value matches the one from previous ?th row? (? is dynamic)
body: <p>Here is my data set. 
  <a href="https://i.stack.imgur.com/wQNeY.png" rel="nofollow noreferrer">Data in</a></p>
  
  <p>I'd like to check if the gender with "Potential Original" matched the gender with "Potential Duplicate'. There is no specified group but 1 duplicate + 1 or more original acted like a group.</p>
  
  <p>Here is the output I want (for duplicate it's NA because it's comparing to itself). 
  <a href="https://i.stack.imgur.com/3Vojn.png" rel="nofollow noreferrer">Data out</a></p>
  
  <p>Appreciate your help. Thanks.</p>