View source: R/coalesce_join.R
coalesce_join | R Documentation |
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).
coalesce_join(
x,
y,
by = NULL,
suffix = c(".x", ".y"),
join = dplyr::left_join,
...
)
x |
left-hand data frame |
y |
right-hand data frame |
by |
which column(s) to join by |
... |
originally from: https://alistaire.rbind.io/blog/coalescing-joins/
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.