itertools (version 0.1-3)

enumerate: Create an enumeration object

Description

Create an iterator that iterates over an iterable, returning the value in a list that includes an index.

Usage

enumerate(iterable)

Arguments

iterable
Iterable to iterate over.

Examples

Run this code
# Create an enumeration of five random numbers
as.list(enumerate(rnorm(5)))

Run the code above in your browser using DataLab