coalesce_xy: Coalesce helpers

View source: R/coalesce.R

coalesce_xyR Documentation

Coalesce helpers

Description

These are wrappers around dplyr::coalesce, designed for convenient use in the conflict argument of powerjoin's join functions. coalesce_xy() is just like dplyr::coalesce (except it takes only 2 arguments), coalesce_yx() looks first in y and then in x if y is missing.

Usage

coalesce_xy(x, y)

coalesce_yx(x, y)

Arguments

x

A vector

y

A vector

Value

A vector

Examples

coalesce_xy(c(NA, 2, 3), c(11, 12, NA))
coalesce_yx(c(NA, 2, 3), c(11, 12, NA))

powerjoin documentation built on Nov. 3, 2022, 5:05 p.m.