coalesce_join: Coalescing join function which will update NA values in the...

View source: R/coalesce_join.R

coalesce_joinR Documentation

Coalescing join function which will update NA values in the left-hand data frame

Description

This is a combination of join functions and the coalesce function from dplyr. It is a convenient way to solve the generic task of updating a data frame (replacing NAs) with another one that holds additional information. In its current form the information (non-NA) in the left-hand data frame (x) will be prioritized over that information in the right-hand data frame (y).

Usage

coalesce_join(
  x,
  y,
  by = NULL,
  suffix = c(".x", ".y"),
  join = dplyr::left_join,
  ...
)

Arguments

x

left-hand data frame

y

right-hand data frame

by

which column(s) to join by

...

Details

originally from: https://alistaire.rbind.io/blog/coalescing-joins/


Close-your-eyes/scexpr documentation built on April 21, 2023, 10:27 a.m.