setleftjoin | R Documentation |
r
to l
by reference.
Requires that r
has at most one item of each join group in order to be able to simply add to l
.setleftjoin
Fast left join for data.table that simply adds columns from r
to l
by reference.
Requires that r
has at most one item of each join group in order to be able to simply add to l
.
setleftjoin(l, r, by = NULL)
l |
left side of the join (data.table) |
r |
right side of the join (data.table) |
by |
character vector for matching columns. Names, if they exist, refer to columns in the left table, values to columns in the right table |
a joined data.table, invisibly
library(data.table)
l <- data.table(a = c(1, 2, 3), b = c(3, 4, NA))
r <- data.table(b = c(3, 7, NA), c = c(1, 2, 4))
setleftjoin(l, r, by = "b")
setleftjoin(l, r, by = c("b" = "c"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.