Learn R Programming

Kmisc (version 0.5.0)

chunk: Generate a Sequence of Integers, and Split into Chunks

Description

This function takes a set of endpoints, and 'chunks' the sequence from min to max into a list with each element of size size.

Usage

chunk(min, max, size, by = 1)

Arguments

min
The lower end (start point) of the sequence.
max
The upper end (end point) of the sequence.
size
The number of elements to place in each chunk.
by
The difference between consecutive elements.

Details

If max is not specified, then we generate a chunk of integers from 1 to min, each of size size. This allows you to specify chunks with syntax like chunk(100, size=5).