| rray_reverse | R Documentation |
rray_reverse() reverses the order of the elements of x along one or more
axes.
rray_reverse(x, ..., axes)
x |
An array. |
... |
These dots are for future extensions and must be empty. |
axes |
The axes to reverse along, given by position or by title. |
Names on a reversed axis move with the data. Every other axis keeps its names
untouched. The titles of x are kept.
An array with the same type and dimensions as x.
rray_reverse(1:5, axes = 1)
x <- matrix(1:6, nrow = 2, dimnames = list(c("r1", "r2"), c("a", "b", "c")))
# Reverse the rows, names move with the data
rray_reverse(x, axes = 1)
# Reverse the columns
rray_reverse(x, axes = 2)
# Reverse both axes
rray_reverse(x, axes = c(1, 2))
# Reverse the columns, by title
y <- rray_set_titles(x, c("row", "col"))
rray_reverse(y, axes = "col")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.