Reading the new join vignettes I found
|
- The date related `ProductReceivedProd2` was omitted from this new table. |
|
|
|
```{r} |
|
ProductReceivedProd2[ProductSalesProd2, |
|
on = list(product_id, date < date)] |
|
``` |
which I did not understood initially the full consequences of this, but later, working with my own data, I realised it means losing data from x (if doing x[y, on = .(xid = yid, date < ydate),...]).
I may use something like x[y, on = .(xid = yid), j = .(date = x.date), ...], but then I have to specify inside j = .(...) all the columns from x and y (which may be a lot). I have tried including .SD, x.SD, x..SD, i.SD, i..SD in distinct ways, but nothing of this works.
Is there an abbreviated way to include all x and y (i) columns in the join, while using j to specify some names or some concrete data columns?
Reading the new join vignettes I found
data.table/vignettes/datatable-joins.Rmd
Lines 557 to 562 in 4f7f567
which I did not understood initially the full consequences of this, but later, working with my own data, I realised it means losing data from
x(if doingx[y, on = .(xid = yid, date < ydate),...]).I may use something like
x[y, on = .(xid = yid), j = .(date = x.date), ...], but then I have to specify insidej = .(...)all the columns fromxandy(which may be a lot). I have tried including.SD,x.SD,x..SD,i.SD,i..SDin distinct ways, but nothing of this works.Is there an abbreviated way to include all
xandy(i) columns in the join, while usingjto specify some names or some concrete data columns?