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

reverse-methods

Reverse an XVector or XVectorList object


Description

Methods for reversing an XVector or XVectorList object.

Usage

## S4 method for signature 'XVector'
reverse(x, ...)
## S4 method for signature 'XVectorList'
reverse(x, ...)

Arguments

x

An XVector or XVectorList object.

...

Additional arguments. Currently ignored.

Details

On an XVector object, reverse and rev are equivalent, i.e. they both reverse the order of their elements.

On an XVectorList object, reverse reverses each element individually, without modifying the top-level order of the elements. It's equivalent to, but more efficient than, doing endoapply(x, rev).

Value

An object of the same class and length as the original object.

See Also

Examples

## On an XInteger object:
x <- as(12:-2, "XInteger")
reverse(x)

## On an XIntegerViews object:
v <- successiveViews(x, 1:5)
v
reverse(v)

## On an XVectorList object:
if (require(Biostrings) && require(drosophila2probe)) {
  library(Biostrings)
  library(drosophila2probe)
  probes <- DNAStringSet(drosophila2probe)
  reverse(probes)
}

XVector

Foundation of external vector representation and manipulation in Bioconductor

v0.30.0
Artistic-2.0
Authors
Hervé Pagès and Patrick Aboyoun
Initial release

We don't support your browser anymore

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