reverse_vector {bit}R Documentation

Reverse atomic vector

Description

Returns a reversed copy – with attributes retained.

Usage

reverse_vector(x)

Arguments

x

an R vector

Details

This is substantially faster than rev

Value

a reversed vector

See Also

rev, copy_vector

Examples

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

## End(Not run)

[Package bit version 4.0.5 Index]