powered by
Returns a reversed copy -- with attributes retained.
reverse_vector(x)
a reversed vector
an R vector
This is substantially faster than rev
rev
rev, copy_vector
copy_vector
x <- factor(letters) rev(x) reverse_vector(x) if (FALSE) { x <- 1:1e7 system.time(rev(x)) system.time(reverse_vector(x)) }
Run the code above in your browser using DataLab