Description Usage Arguments Details Value Author(s) See Also Examples
Perform batch join of multiple tables to one master table.
1 |
master |
data.table, optionally also a single data.table nested in the list. |
join |
list of data.tables which to join to master data.table. |
by |
list of character vectors. Default: |
col.subset |
list of character vectors. Default: |
row.subset |
list of expressions to be passed to corresponding join data.table |
nomatch |
list of integer scalars |
allow.cartesian |
list of logical scalar elements corresponding to |
Any NULL
inside the lists provided to by, col.subset, row.subset, nomatch, allow.cartesian will be replaced by the default value for particular NULL
element. Therefore it is possible to pass partially filled lists, length of each must match to length of join, example col.subset=list(NULL,c("join2_col1","join2_col2"),NULL,c("join4_col1"))
.
Function do not allow cross tables row.subset filtering expressions. User should apply such filter after joinbyv
, example: joinbyv(master, join)[join1_colA > join2_colA * 2]
.
Arguments nomatch, allow.cartesian by default will be setup according to data.table options. An exception case described in row.subset argument will by default override the nomatch argument to value 0
to perform inner join.
Possibly the performance might be improved after implementing data.table FR #691 and #692.
data.table, denormalized master table joined to defined join data.tables. Column order according to col.subset
, no key.
Jan Gorecki
build_hierarchy, dw.populate
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | suppressPackageStartupMessages(library(dwtools))
X <- dw.populate() # scenario="star"
lapply(X, head)
DT <- joinbyv(master = X$SALES,
join = list(time = X$TIME, product = X$PRODUCT, currency = X$CURRENCY),
by = list("time_code","prod_code","curr_code"))
str(DT)
# joinbyv including timing
DT <- timing(
joinbyv(master = X$SALES,
join = list(time = X$TIME, product = X$PRODUCT, currency = X$CURRENCY),
by = list("time_code","prod_code","curr_code"))
)
get.timing()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.