Learn R Programming

FastUtils (version 0.2.1)

zipit: Zip Multiple Vectors or Lists

Description

This function combines multiple vectors or lists element-wise into a list of lists. It's a slightly lighter weight alternative to itertools::izip()

Usage

zipit(...)

Value

A list of lists, where each inner list contains the elements from the corresponding positions in the input vectors or lists.

Arguments

...

Vectors or lists to be combined.

See Also

enumerateit()

Examples

Run this code
# Zip two vectors
zipit(c(1, 2, 3), c("a", "b", "c"))
# Zip three vectors
zipit(c(1, 2), c("x", "y"), c(TRUE, FALSE))

Run the code above in your browser using DataLab