R: Reverse atomic vector

reverse {bit} | R Documentation

## Reverse atomic vector

### Description

Returns a reversed copy – with attributes retained.

### Usage

    reverse(x)

### Arguments

`x` | an R vector

### Details

This is substantially faster than `rev`

### Value

a reversed vector

### See Also

`rev`, `copy`

### Examples

    x <- factor(letters)
    rev(x)
    reverse(x)
    ## Not run:
    x <- 1:1e7
    system.time(rev(x))
    system.time(reverse(x))

    ## End(Not run)

[Package bit version 4.0.3 Index]