diagX.Rd
Compute the other diagonal identity matrix. The result is basically a fast version of diag(n)[, n:1].
diag(n)[, n:1]
diagX(n)
positive integer.
a numeric \(n \times n\) matrix with many zeros – apart from 1s in the other diagonal.
1
Martin Maechler, 1992.
diag.
diag
diagX(4) #> [,1] [,2] [,3] [,4] #> [1,] 0 0 0 1 #> [2,] 0 0 1 0 #> [3,] 0 1 0 0 #> [4,] 1 0 0 0 for(m in 1:5) stopifnot(identical(diagX(m), diag(m)[, m:1, drop = FALSE]))