lookup_dt | R Documentation |
Executes a lookup operation between two data.tables by matching on common key columns.
The lookup is conducted on key columns (which are factors or integers starting from 1) and maps each
unique combination to a corresponding index. The lookup values are then merged into the main table
or returned separately based on the merge
parameter.
lookup_dt(
tbl,
lookup_tbl,
merge = TRUE,
exclude_col = NULL,
check_lookup_tbl_validity = FALSE
)
tbl |
The main data.table on which the lookup operation is performed. |
lookup_tbl |
A data.table containing the lookup values, with key columns matching those in |
merge |
Logical. If |
exclude_col |
A character vector specifying column names to exclude from the lookup keys. |
check_lookup_tbl_validity |
Logical. If |
A data.table. When merge = TRUE
, tbl
is returned with additional lookup columns;
otherwise, a data.table containing only the lookup results is returned.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.