Description Usage Arguments Examples
This avoids generating left duplicates if entries are duplicated in the right by
.
If duplicates are generated, the function will stop with an error.
1 | safe.mapping(x, map, by = NULL)
|
x |
the |
map |
a |
by |
see |
1 2 3 4 5 6 7 8 9 10 11 12 | a <- data.frame(A = LETTERS[1:5], B = 1:5)
b <- data.frame(A = LETTERS[1:5], C = 15:11)
dplyr::left_join(a, b)
safe.mapping(a, b)
# Now with duplicates
## Not run:
c <- data.frame(A = LETTERS[1:5], C = 20:11)
dplyr::left_join(a, c) # creates duplicates of x
safe.mapping(a, c) # stops with an error
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.