This function is deprecated in favor of the more flexible chunk
, lpt
and binpack
.
chunkIds(ids = NULL, n.chunks = NULL, chunk.size = NULL,
group.by = character(0L), reg = getDefaultRegistry())
Arguments
ids |
[data.frame or integer ]
A data.frame (or data.table )
with a column named “job.id”.
Alternatively, you may also pass a vector of integerish job ids.
If not set, defaults to all jobs.
Invalid ids are ignored. |
n.chunks |
[integer(1) ]
Requested number of chunks.
The function chunk distributes the number of elements in x evenly while
lpt tries to even out the sum of elements in each chunk.
If more chunks than necessary are requested, empty chunks are ignored.
Mutually exclusive with chunks.size . |
chunk.size |
[integer(1) ]
Requested chunk size for each single chunk.
For chunk this is the number of elements in x , for binpack the size
is determined by the sum of values in x .
Mutually exclusive with n.chunks . |
group.by |
[character(0) ]
If ids is a data.frame with additional columns
(in addition to the required column “job.id”), then the chunking is performed using
subgroups defined by the columns set in group.by .
See example. |
reg |
[Registry ]
Registry. If not explicitly passed, uses the default registry (see setDefaultRegistry ). |
Value
[data.table
] with columns “job.id” and “chunk”.
See also