reverse_vector | R Documentation |
Returns a reversed copy – with attributes retained.
reverse_vector(x)
x |
an R vector |
This is substantially faster than rev
a reversed vector
rev
, copy_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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.