Description Usage Arguments Value Examples
Full join: join two data frames preserving all possible information
Left join: Join two data frames by matching the second (right) data frame to the left (first) such that the structure of the first (left) data frame is preserved
Right join: Join two data frames by matching the first (left) data frame to the right (second) such that the structure of the second (right) data frame is preserved
1 2 3 4 5 | full_join_data(x, y, by = NULL)
left_join_data(x, y, by = NULL)
right_join_data(x, y, by = NULL)
|
x |
Left or first data frame |
y |
Right or second data frame |
by |
Name (character) of variable(s) on which to join |
Joined (merged) data frame
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | d1 <- tbl_data(
x = 1:10,
y = rnorm(10),
z = letters[1:10]
)
d2 <- tbl_data(
x = sample(1:10, 20, replace = TRUE),
y2 = rnorm(20)
)
## left join
left_join_data(d1, d2)
## right join
right_join_data(d1, d2)
## full join
full_join_data(d1, d2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.