0

I'm doing a left_join on two dataframes: file1 and file2. file1's length is 1323 records and has some duplicate rows which I need preserved. file2 has 443 records. I'm joining them on 3 conditions.

file1 <- left_join(file1, file2, by=c("ID", "Name", "Value"))

post which I get 1327 records, an additional pair each for the two duplicate pairs. How can I ensure I get only the original records from file1 only post the join??

AndrewGB
  • 16,126
  • 5
  • 18
  • 49
  • Well the nature of a left join ensures that. – Bensstats Feb 08 '22 at 20:18
  • [See here](https://stackoverflow.com/q/5963269/5325862) on making a reproducible example that is easier for folks to help with. There's no way for us to know what's in either of these data frames, but if there are duplicate matches, there will be duplicates in your data. Not sure what you would want to happen instead – camille Feb 08 '22 at 22:12

0 Answers0