title: How to do a conditional join in R with dplyr?
body: <p>For example, df1 looks like below -</p>
  
  <pre><code>X1         X2     X3     X4         X5
  Apple   Belgium   Red   Purchase   100 
  Guava   Germany   Green Sale       200
  Grape   Italy     Purple Purchase   500
  Orange India   Orange   Sale       2000 
  </code></pre>
  
  <p>df2 looks like below - </p>
  
  <pre><code> X1         X2     X3     X4         X5
  Apple   Belgium   Red   Purchase   10000 
  Guava   Germany   Green Sale       20000
  Grape   Italy     Purple Purchase   
  Orange India   Orange   Sale       2000 
  </code></pre>
  
  <p>My output should look like -</p>
  
  <pre><code> X1         X2     X3     X4         X5.x  X5.y
  Apple   Belgium   Red   Purchase   100     10000
  Guava   Germany   Green Sale       200    20000
  Grape   Italy     Purple Purchase   500   NA
  </code></pre>
  
  <p>Here multiple operations are involved -</p>
  
  <ol>
  <li><p>Pick the rows present in 1 and not in other, vice versa </p></li>
  <li><p>Pick the mismatches in X5 column (X5 is my target column) when the first 4 column matches</p></li>
  <li><p>I do not want the matches.</p></li>
  </ol>
  
  <p>I tried a combination of inner_join, full_join and anti_join of both to obtain the part1. How do I perform the second part? Is there a conditional join available in R that picks only the mismatches and ignores when the target column is same?</p>
  
  <p>I don't want to use sqldf. I know this can be achieved in SQL. I want to do this in dplyr. Any help is much appreciated.</p>
  
  <p>TIA.</p>