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