splitKeepOrderAndDTIntegrity | R Documentation |
split
for a data.table that keeps integrity of a column of lists of data.table objectsdata.table::split
does 2 bad things:
reorders if using f
destroys the integrity of a column that is a list of data.tables, when using by
So, to keep order, need by
, but to keep integrity, need f
. This function
splitKeepOrderAndDTIntegrity(pkgDT, splitOn)
pkgDT |
A |
splitOn |
Character vector passed to |
A list of data.table
objects of length(unique(splitOn))
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.