reverse_vector: Reverse atomic vector

View source: R/integerutil.R

reverse_vectorR 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)

bit documentation built on Sept. 20, 2024, 5:08 p.m.