makeChunks: Create Chunks of Index Vectors

Description Usage Arguments Value Control processing order of elements

View source: R/chunks.R

Description

This is an internal function.

Usage

1
2
makeChunks(nbrOfElements, nbrOfWorkers, future.scheduling = 1,
  future.chunk.size = NULL)

Arguments

nbrOfElements

(integer) Total number of elements to iterate over.

future.scheduling

(numeric) A strictly positive scalar. Only used if argument future.chunk.size is NULL.

future.chunk.size

(numeric) The maximum number of elements per chunk, or NULL. If NULL, then the chunk sizes are given by the future.scheduling argument.

nbrOfWorker

(integer) Number of workers available.

Value

A list of chunks, where each chunk is an integer vector of unique indices [1, nbrOfElements]. The union of all chunks holds nbrOfElements elements and equals 1:nbrOfElements. If nbrOfElements == 0, then an empty list is returned.

Control processing order of elements

Attribute ordering of future.chunk.size or future.scheduling can be used to control the ordering the elements are iterated over, which only affects the processing order not the order values are returned. This attribute can take the following values:


doFuture documentation built on Oct. 30, 2019, 12:13 p.m.