行列を回転

画像回転のための準備。

m <- matrix(1:12, 3)
nc <- ncol(m)
nr <- nrow(m)

m
t(m)[seq(nc,1),]
m[seq(nr,1),seq(nc,1)]
t(m)[seq(1,nc),seq(nr,1)]