Learn R Programming

itertools2

The R package itertools2 is a port of Python's excellent itertools module to R for efficient looping and is a replacement for the existing itertools R package.

Installation

You can install the stable version on CRAN:

install.packages('itertools2', dependencies=TRUE)

If you prefer to download the latest version, instead run the following after installing devtools:

devtools::install_github('ramhiser/itertools2')

License

The itertools2 R package is licensed under the MIT License. However, this package depends on the iterators R package, which is licensed under the Apache License, Version 2.0. Both packages are freely available for commercial and non-commerical usage. Please consult the licensing terms for more details.

Copy Link

Version

Install

install.packages('itertools2')

Monthly Downloads

382

Version

0.1.1

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

John Ramey

Last Published

August 8th, 2014

Functions in itertools2 (0.1.1)

itertools2

itertools2: Functions creating iterators for efficient looping
dotproduct

Computes the dot product of two iterable objects
icompress

Iterator that filters elements where corresponding selector is false.
irepeat

Iterator that returns an object indefinitely
iter_length

Helper function that determines the length of an iterator object
itakewhile

Iterator that returns elements while a predicate function returns TRUE
try_nextElem

Calls iterators::nextElem(). If error, returns default value.
consume

Consumes the first n elements of an iterator
ifilter

Iterator that filters elements not satisfying a predicate function
take

Return the first n elements of an iterable object as a list
izip_longest

Iterator that iterates through several iterables concurrently.
ilength

Consumes an iterator and computes its length
iunique_justseen

Iterator that extracts the just-seen unique elements from an iterable object
imap

Iterator that applies a given function to several iterables concurrently.
ipairwise

Iterator that returns elements of an object in pairs
iunique

Iterator that extracts the unique elements from an iterable object
iproduct

Iterator that returns the Cartesian product of the arguments.
izip

Iterator that iterates through several iterables concurrently.
iter_deepcopy

Performs a deep copy of an iterator
itabulate

Iterator that maps a function to a sequence of numeric values
islice

Iterator that returns selected elements from an iterable.
icount

Iterator of neverending numeric sequence with initial value and step size
ichain

Iterator that chains multiple arguments together into a single iterator
nth

Returns the nth item of an iterator
istarmap

Iterator that applies a given function to the elements of an iterable.
iseq

Iterators for sequence generation
ichunk

Iterator that returns elements in fixed-length chunks
icycle

Iterator that cycles indefinitely through an iterable object
irep

Iterator that replicates elements of an iterable object
ienumerate

Iterator that returns the elements of an object along with their indices
is_iterator

Helper function that determines whether is an iterator object
iroundrobin

Iterator that traverses each given iterable in a roundrobin order
stop_iteration

Helper function that determines whether an object inherits from a StopIteration exception
idropwhile

Iterator that drops elements until the predicate function returns FALSE
ipad

Iterator that returns an object followed indefinitely by a fill value
itee

Returns a list of n independent iterators from a single iterable object
quantify

Count the number of times an iterable object is TRUE