left_join: left_join

Description Usage Arguments Details Examples

Description

implements a default left join for data.table

Usage

1
2
## S3 method for class 'data.tableoff'
x[i, ...]

Arguments

x

data.table

i

object

Details

By convention DT implements DT[X] as a RIGHT JOIN. This convention promotes facts, i.e. the most quickly varying values to be on the RHS of the result. This is anathema to the convention of modeling where the Y's are expressed first. '

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
 x <- data.table( letters=letters, i=1:26 )
 setkey(x, letters )

 rhs <- data.table( letters=letters[1:5], i=1:5 )
 setkey(rhs, letters )

 data.table:::`[.data.table`(x,rhs)      # RIGHT JOIN

 options( datatable.default.left.join = FALSE )
 x[rhs, on=.(letters)]                     # RIGHT JOIN
 options( datatable.default.left.join = TRUE )
 x[rhs, on=.(letters)]

decisionpatterns/data.table.plus documentation built on June 15, 2020, 10:26 p.m.