Learn R Programming

soundgen (version 2.7.0)

splitIntoChunks: Split vector into chunks

Description

Internal soundgen function.

Usage

splitIntoChunks(x, n)

Value

Returns a list of length n containing the chunks

Arguments

x

numeric vector to split

n

number of chunks

Details

Takes a numeric vector x and splits it into n chunks. This is the fastest splitting algorithm from https://stackoverflow.com/questions/3318333/split-a-vector-into-chunks

Examples

Run this code
# prepare chunks of iterator to run in parallel on several cores
chunks = soundgen:::splitIntoChunks(1:21, 4)
chunks

Run the code above in your browser using DataLab