safe_join | R Documentation |
Just a simple wrapper around dplyr::left_join
to stop myself
from accidentally many-to-one joining when I don't expect to.
safe_join(x, y, ...)
x, y |
tbls to join |
... |
other arguments to be passed to |
a tbl
Saftey first!
Sven Halvorson
## Not run:
df1 = tibble(
x = 1:5,
y = letters[1:5],
z = LETTERS[1:5]
)
df2 = tibble(
x = c(1:4, 4),
j = LETTERS[5:1]
)
safe_join(df1, df2)
safe_join(df1, df2, by = c('z' = 'j'), suffix = c('_left', '_right'))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.