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