pair {HelloRanges} | R Documentation

## Pair up two vectors

### Description

Creates a Pairs from two vectors, optionally via a left outer join.

### Usage

    pair(x, y, ...)
    ## S4 method for signature 'Vector,Vector'
    pair(x, y, by = findMatches(x, y), all.x = FALSE,
                       NA.VALUE = y[NA])

### Arguments

`x` | The “first” vector.
`y` | The “second” vector.
`by` | The `Hits-class` object that matches up the elements into pairs.
`all.x` | If `TRUE`, keep every member of `x`, even if it has no hits. The “second” component is filled with the `NA.VALUE`.
`NA.VALUE` | The value to fill holes in `y` when `all.x` is `TRUE`.
`...` | Arguments for methods.

### Details

This might move to S4Vectors at some point. It is distinct from simple `Pairs` construction, because it performs transformations like a left outer join. More options might be added in the future.

For GRanges and other ranged objects, `pair` adds “.” to the seqlevels, because that is the seqname of the missing GRanges.

### Value

A Pairs object

### Author(s)

Michael Lawrence

### See Also

`Pairs-class`, created by this function. `bedtools_intersect`, whose `loj` argument motivated the creation of this function.

[Package HelloRanges version 1.8.0 Index]