Learn R Programming

Require (version 1.0.1)

splitKeepOrderAndDTIntegrity: split for a data.table that keeps integrity of a column of lists of data.table objects

Description

data.table::split does 2 bad things:

  1. reorders if using f

  2. 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

Usage

splitKeepOrderAndDTIntegrity(pkgDT, splitOn)

Value

A list of data.table objects of length(unique(splitOn)).

Arguments

pkgDT

A pkgDT object e.g., from toPkgDT

splitOn

Character vector passed to data.table::split(..., f = splitOn)