Description Usage Arguments Details Value Examples
View source: R/primitive.matrix.functions.R
Rotate matrix 90 degrees clockwise
1 | rotate.right(x)
|
x |
a 2d-matrix |
t(apply(x,2,rev))
the given matrix rotated 90 degrees clockwise
1 2 3 4 5 6 7 8 9 10 11 | a<-matrix(1:9,3,3)
a
# [,1] [,2] [,3]
#[1,] 1 4 7
#[2,] 2 5 8
#[3,] 3 6 9
rotate.right(a)
# [,1] [,2] [,3]
#[1,] 3 2 1
#[2,] 6 5 4
#[3,] 9 8 7
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.