title: Merging dataframes in R - resulting dataframe is too large
body: <p>I am trying to merge two dataframes in R, joining them by the one column that they share.
  Here are screenshots of the two dataframes, and I am merging on the column &quot;INC_KEY&quot;.</p>
  <p><a href="https://i.stack.imgur.com/EYdYP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EYdYP.png" alt="enter image description here" /></a></p>
  <p><a href="https://i.stack.imgur.com/k2Q84.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/k2Q84.png" alt="enter image description here" /></a></p>
  <p>This is the code I have written to merge the two dataframes:
  dp &lt;- inner_join(d,p,by=&quot;INC_KEY&quot;)</p>
  <p>d has 177156 observations, and p has 1641137 observations, but the final merged dataframe has 8416113 observations, which does not make sense to me. I have also tried changing the inner_join function above to the merge function, but I still get the same result. I am wondering how to fix this code so that the merged dataframe has a realistic number of observations - thanks so much for any help!</p>