zip: Transposition of sequences

Description Usage Arguments Details Value See Also Examples

View source: R/functional.R

Description

zip takes lists, vectors or pairlists and creates new ones that represent the transposition of the originals.

Usage

1

Arguments

...

Sequences to zip.

Details

"Transposition" here is meant in the following sense: given n sequences of length m, return m sequences of length n. This sounds confusing but is quite intuitive in practice - see the examples.

If not all sequences are the same length, shorter sequences are recycled to match the lengths of longer ones.

For those familiar with Python, this is just like the built-in Python zip function.

Value

The zipped sequences.

See Also

link{for.each} for application of an arbitrary function to zipped sequences of values.

Examples

1
2
3
4
5
f <- 1:5
g <- 5:10
h <- 11:15

zip(f, g, h)

wwbrannon/schemeR documentation built on May 4, 2019, 12:03 p.m.