Skip to content

Commit 1a6540a

Browse files
committed
refined version
1 parent acef6bb commit 1a6540a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

vignettes/datatable-joins.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,7 @@ When we need to update `Products` with multiple columns from `ProductPriceHistor
796796
cols <- setdiff(names(ProductPriceHistory), 'product_id')
797797
Products[ProductPriceHistory,
798798
on = .(id = product_id),
799-
(cols) := lapply(cols, function(cn) get(paste0("i.", cn)))]
799+
(cols) := mget(paste0("i.", cols))]
800800
```
801801
- Efficiently updates multiple columns in `Products` from `ProductPriceHistory`.
802802
- `mget(cols)` retrieves multiple matching columns dynamically.

0 commit comments

Comments
 (0)