-1

I have two dataframes A and B, with 40k and 110k observations on the same variable, ID. I want to create C, which is all rows which are in A but not in B and nor at the intersection. Trying

ans <- dplyr::left_join(A,B, by "ID")

If I use a left join, I will have about 40K rows.But the right result is around 200 rows. Any hint?

Frank
  • 66,179
  • 8
  • 96
  • 180

1 Answers1

1

The result of the left join is fine. Left join will give you all the rows in the left list (in your case A) and the rows which have matching keys in your right list (list B). Which means all rows in A will be selected in the left join.

Maybe subset can solve your problem

yonBav
  • 1,695
  • 2
  • 17
  • 31