setleftjoin: setleftjoin Fast left join for data.table that simply adds...

View source: R/setleftjoin.R

setleftjoinR Documentation

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.

Description

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.

Usage

setleftjoin(l, r, by = NULL)

Arguments

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

Value

a joined data.table, invisibly

Examples


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"))


skysyzygy/tessilake documentation built on June 14, 2025, 6:50 p.m.