clone_dt | R Documentation |
'clone_dt' clones a data.table and binds the copies at the bottom of
the original data.table. It also creates an column named `.id`
to identify each iteration. The keys of the input data.table are retained.
clone_dt(dtb, times, idcol = TRUE)
dtb |
A data.table to be cloned |
times |
The number of cloning iterations |
idcol |
= TRUE Creates a new column containing the id of each data.table iteration |
A data.table binding the original one and the new iterations with a column for the id of each iteration, invisibly
library(data.table)
library(CKutils)
x <- c(1, 5, 3, 6, 4, 2, 9, 8, 7)
dtb <- data.table(x)
clone_dtb(dtb, 3, idcol = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.