[R] anti off diagonal min max mean - how to rotate matrix by 90 degree

Witold E Wolski wewolski at gmail.com
Wed Jul 17 22:04:52 CEST 2013


How can id do this efficiently in R ?

1 0 0
0 2 0
0 0 3


rotate right
0 0 1
0 2 0
3 0 0
rotate left
0 0 3
0 2 0
1 0 0

What I want to do is described here:
http://stackoverflow.com/questions/13049575/r-min-max-and-mean-of-off-diagonal-elements-in-a-matrix

but I want do to it for all off-anti-diagonals.

I am also concerned that the method described on stackoverflow isn't
necessarily efficient.
I work with matrices of size 3k * 3k.


--
Witold Eryk Wolski



More information about the R-help mailing list