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

reverse_vector

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

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

Classes and Methods for Fast Memory-Efficient Boolean Selections

v4.0.4
GPL-2 | GPL-3
Authors
Jens Oehlschlägel [aut, cre], Brian Ripley [ctb]
Initial release
2020-08-03

We don't support your browser anymore

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