GetChunks: Get chunks of a specific size

get_chunksR Documentation

Get chunks of a specific size

Description

From a vector obtain a list of chunks of a specific size

Usage

get_chunks(x, chunksize)

Arguments

x

Input vector

chunksize

The size of the chunks

Details

This is a utility functiion that facilitates chunked operations.

A common scenario is to chunk the indices of a specific object and then perform operations on the chunks separately and then later merge the output.

This can be useful in situations where multiple operations of smaller scope is preferrable to bulk processing.

Value

A list of objects of the same data type as input, each of size equal to the chunk size.

The last chunk may be smaller if the input's length is not a multiple of the LCM of the input's length and the chunks size.

See Also

get_chunked_redcap_data


smockin/RedcapData documentation built on Feb. 2, 2023, 3:19 a.m.