View source: R/utils_data.table.R
| dt_merge | R Documentation |
Merge data.tables
dt_merge(
left,
right,
on = NULL,
left_on = NULL,
right_on = NULL,
how = "left",
left_name = NULL,
right_name = NULL,
left_suffix = NULL,
right_suffix = NULL,
verbosity = 1L,
...
)
left |
data.table |
right |
data.table |
on |
Character: Name of column to join on. |
left_on |
Character: Name of column on left table. |
right_on |
Character: Name of column on right table. |
how |
Character: Type of join: "inner", "left", "right", "outer". |
left_name |
Character: Name of left table. |
right_name |
Character: Name of right table. |
left_suffix |
Character: If provided, add this suffix to all left column names, excluding on/left_on. |
right_suffix |
Character: If provided, add this suffix to all right column names, excluding on/right_on. |
verbosity |
Integer: Verbosity level. |
... |
Additional arguments to be passed to |
Merged data.table.
EDG
library(data.table)
xleft <- data.table(ID = 1:5, Alpha = letters[1:5])
xright <- data.table(ID = c(3, 4, 5, 6), Beta = LETTERS[3:6])
xlr_inner <- dt_merge(xleft, xright, on = "ID", how = "inner")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.