RotateRight[expr,n]
cycles the elements in expr n positions to the right.
RotateRight[expr]
cycles one position to the right.
RotateRight[expr,{n1,n2,…}]
cycles elements at successive levels ni positions to the right.
RotateRight
RotateRight[expr,n]
cycles the elements in expr n positions to the right.
RotateRight[expr]
cycles one position to the right.
RotateRight[expr,{n1,n2,…}]
cycles elements at successive levels ni positions to the right.
Details
- RotateRight[expr,-n] rotates n positions to the left.
- RotateRight can be used on SparseArray and Association objects.
Examples
open all close allBasic Examples (4)
Rotate two positions to the right:
RotateRight[{a, b, c, d, e}, 2]Rotate one position to the right:
RotateRight[{a, b, c, d, e}]Rotate Association one position to the right:
RotateRight[<|1 -> a, 2 -> b, 3 -> c|>]Rotate Association on the first and second levels:
RotateRight[<|1 -> {a, b}, 2 -> {b, c}, 3 -> {c, d}|>, {1, 1}]Generalizations & Extensions (2)
Applications (4)
Successively rotate a list right:
NestList[RotateRight, {a, b, c, d, e}, 4]Rotate successive rows of a matrix by their row number:
MapIndexed[RotateRight, Table[{a, b, c, d}, {5}]]//TableFormArrayPlot[RotateRight[Table[If[x ^ 2 + y ^ 2 < 1, 1, 0], {x, -1, 1, 1 / 100}, {y, -1, 1, 1 / 100}], {40, 20}]]RotateRight[a.b.c.d.e]See Also
Tech Notes
Related Guides
History
Introduced in 1988 (1.0) | Updated in 2003 (5.0)
Text
Wolfram Research (1988), RotateRight, Wolfram Language function, https://reference.wolfram.com/language/ref/RotateRight.html (updated 2003).
CMS
Wolfram Language. 1988. "RotateRight." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2003. https://reference.wolfram.com/language/ref/RotateRight.html.
APA
Wolfram Language. (1988). RotateRight. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/RotateRight.html
BibTeX
@misc{reference.wolfram_2026_rotateright, author="Wolfram Research", title="{RotateRight}", year="2003", howpublished="\url{https://reference.wolfram.com/language/ref/RotateRight.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_rotateright, organization={Wolfram Research}, title={RotateRight}, year={2003}, url={https://reference.wolfram.com/language/ref/RotateRight.html}, note=[Accessed: 13-June-2026]}