ichunk: Iterate over chunks of a vector

View source: R/chunkapply.R

ichunkR Documentation

Iterate over chunks of a vector

Description

This returns an iterator that counts from one, returning integer sequences of a pre-specified length with each iteration up until an optional maximum value.

Usage

ichunk(chunksize, count = NULL)

Arguments

chunksize

How long should each sequence be?

count

What should be the maximum value returned by the iterator? Above this value, the iterator will return NULL.

Value

An iterator function.

Note

This does not return an iterator in the manner used by the iterators package, since those objects currently misbehave in an Rstudio live session.

Examples

myit <- ichunk(chunksize=10,count=15)
myit()
myit()
myit()


Spiritspeak/skMisc documentation built on April 12, 2025, 5:40 a.m.