Incorrect behavior with dplyr's left_join?

后端 未结 2 1482
青春惊慌失措
青春惊慌失措 2021-01-17 14:52

Surely this is not intended? Is this something that happens in other parts of dplyr\'s functionality and should I be concerned? I love the performance and hat

2条回答
  •  鱼传尺愫
    2021-01-17 15:35

    From the dplyr documentation:

    left_join()

    returns all rows from x, and all columns from x and y. Rows in x with no match in y will have NA values in the new columns. If there are multiple matches between x and y, all combinations of the matches are returned.

    semi_join()

    returns all rows from x where there are matching values in y, keeping just columns from x.

    A semi join differs from an inner join because an inner join will return one row of x for each matching row of y, where a semi join will never duplicate rows of x.

    Is semi_join() a valuable option for you?

提交回复
热议问题