Reverse atomic vector
Returns a reversed copy – with attributes retained.
reverse_vector(x)
x |
an R vector |
This is substantially faster than rev
a reversed vector
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)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.