left_join_keep_first_only: Compute a left join, taking only the first match.

Description Usage Arguments Details Value

View source: R/pipeline-helpers.R

Description

In an ordinary left_join, if a row in the left operand has multiple matches in the right operand, you get a copy of the row for each match in the right operand. Sometimes you want just one arbitrary member of the matching set. This could be because the right operand is a one-to-many mapping, and you don't care which one you get (but you want only one), or it could be that you're trying to reproduce the behavior of legacy code that uses match, which has this behavior. This function performs such a join.

Usage

1

Arguments

x

Left table to join

y

Right table to join

by

Vector of id columns. Unlike in other join variants, these must be supplied explicitly.

Details

This function performs a left join, except that if the right operand has multiple matches for a row in the left operand, only the first match is kept. Use this function with caution. The results will depend on the order of the rows in the right operand, meaning that seemingly innocuous changes can produce changes in output. Consider yourself warned.

Value

Joined table. In case of multiple matches, only the first will be included.


rohmin9122/gcam-korea-release documentation built on Nov. 26, 2020, 8:11 a.m.