Description Usage Arguments Value Examples
adds hash column (more info: digest). Hash is calculated on columne specified in 'colnames_for_hash' argument (all columns by default). Function may be useful for creating Primary Key column (e.g. in MySQL )
1 2 3 | add_hash_column(DT_frame, hash_colname = "hash",
colnames_for_hash = colnames(DT_frame), excluded_colnames = c(),
unite = TRUE, cores = 1L, sort_colnames_for_hash = TRUE)
|
DT_frame |
data.table. |
hash_colname |
character; name of hash column |
colnames_for_hash |
character vector; column names to create hash |
excluded_colnames |
character vector; column names NOT to create hash |
unite |
logical; if TRUE, then firstly uses 'tidyr::unite_' on 'colnames_for_hash' and only then creates hash. It matter when data.table is big frame, because it is much faster |
cores |
integer; number of cores to create hash (works only when unite = TRUE); default: 1 |
sort_colnames_for_hash |
logical; if TRUE, sorts columns alphabetically before hash creation |
data.table
1 2 3 4 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.