i_repeat: Create a repeating iterator

View source: R/i_repeat.R

i_repeatR Documentation

Create a repeating iterator

Description

Create an iterator that returns a value a specified number of times.

Usage

i_repeat(x, times)

Arguments

x

The value to return repeatedly.

times

The number of times to repeat the value. Default value is infinity.

Details

Originally from the itertools package.

Value

an iteror.

Examples


# Repeat a value 10 times
unlist(as.list(i_repeat(42, 10)))


iterors documentation built on May 31, 2023, 5:36 p.m.