| rotate | R Documentation |
Rotate all elements n steps to the right. If n is
negative, rotate to the left.
rotate(x, n = 1L)
ref_rotate(x, n = 1L)
## S3 method for class 'Deque'
rotate(x, n = 1L)
## S3 method for class 'Deque'
ref_rotate(x, n = 1L)
x |
any |
n |
|
While rotate uses copy semantics, ref_rotate works by reference,
that is, rotates in place on the original object.
For Deque returns the rotated Deque() object.
d = deque(1, 2, 3, 4)
rotate(d)
rotate(d, n = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.