id_across_datasets {kim} | R Documentation |
ID across datasets
Description
Create an ID column in each of the data sets. The ID values will span across the data sets.
Usage
id_across_datasets(
dt_list = NULL,
id_col_name = "id",
id_col_position = "first",
silent = FALSE
)
Arguments
dt_list |
a list of data.table objects |
id_col_name |
name of the column that will contain ID values.
By default, |
id_col_position |
position of the newly created ID column.
If |
silent |
If |
Value
the output will be a list of data.table objects.
Examples
# running the examples below requires importing the data.table package.
prep(data.table)
id_across_datasets(
dt_list = list(setDT(copy(mtcars)), setDT(copy(iris))))
id_across_datasets(
dt_list = list(setDT(copy(mtcars)), setDT(copy(iris)), setDT(copy(women))),
id_col_name = "newly_created_id_col",
id_col_position = "last")
[Package kim version 0.5.422 Index]