powered by
Split inputs into a number of chunks
make_chunks(x, size = length(x), nchunks = NULL, chunksize = NULL)
The elements of x split into a list of chunks or (when x is missing) a vector of integer indices in the range 1:nchunks
x
1:nchunks
specifying the chunk for each input element .
A vector of inputs e.g. ids, neurons etc (optional, see examples)
The number of inputs (defaults to length(x) when x is present)
length(x)
The desired number of chunks
The desired number of items per chunk
You must specify exactly one of nchunks and chunksize.
nchunks
chunksize
make_chunks(1:11, nchunks=2) make_chunks(size=11, chunksize=2)
Run the code above in your browser using DataLab