S4Vectors (version 0.10.1)

Pairs-class: Pairs objects

Description

Pairs is a Vector that stores two parallel vectors (any object that can be a column in a DataFrame). It provides conveniences for performing binary operations on the vectors, as well as for converting between an equivalent list representation. Virtually all of the typical R vector operations should behave as expected.

A typical use case is representing the pairing from a findOverlaps call, for which findOverlapPairs is a shortcut.

Arguments

See Also

  • Hits-class, a typical way to define a pairing.
  • findOverlapPairsin theIRangespackage, which generates an instance of this class based on overlaps.
  • setops-methodsin theIRangespackage, for set operations on Pairs objects.

Examples

Run this code
p <- Pairs(1:10, Rle(1L, 10), score=rnorm(10), names=letters[1:10])
identical(first(p), 1:10)
mcols(p)$score
pas.data.frame(p)
z <- zipup(p)
first(p) <- Rle(1:10)
identical(zipdown(z), p)

Run the code above in your browser using DataCamp Workspace