Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

zip-methods

Convert between parallel vectors and lists


Description

The zipup and zipdown functions convert between two parallel vectors and a list of doublets (elements of length 2). The metaphor, borrowed from Python's zip, is that of a zipper. The zipup function interleaves the elements of the parallel vectors into a list of doublets. The inverse operation is zipdown, which returns a Pairs object.

Usage

zipup(x, y, ...)
zipdown(x, ...)

Arguments

x,y

For zipup, any vector-like object. For zipdown, a doublet list.

...

Arguments passed to methods.

Value

For zipup, a list-like object, where every element is of length 2. For zipdown, a Pairs object.

See Also

Examples

z <- zipup(1:10, Rle(1L, 10))
pairs <- zipdown(z)

S4Vectors

Foundation of vector-like and list-like containers in Bioconductor

v0.28.1
Artistic-2.0
Authors
H. Pagès, M. Lawrence and P. Aboyoun
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.