diag.ind.Rd
Returns a matrix of logicals the same size of a given matrix with entries 'TRUE' in the upper triangle close to the diagonal.
diag.ind(x, n = 1, diag = TRUE)
x | a matrix. |
---|---|
n | the number of elements from the diagonal to include. |
diag | logical. Should the diagonal be included? |
Basic function useful for masking elements close to the diagonal of a given matrix.
Returns a matrix of logicals the same size of a given matrix with entries 'TRUE' in the upper triangle close to the diagonal.
Grant, B.J. et al. (2006) Bioinformatics 22, 2695--2696.
Barry Grant
#> [,1] [,2] [,3] [,4] [,5] #> [1,] TRUE TRUE TRUE FALSE FALSE #> [2,] FALSE TRUE TRUE TRUE FALSE #> [3,] FALSE FALSE TRUE TRUE TRUE #> [4,] FALSE FALSE FALSE TRUE TRUE #> [5,] FALSE FALSE FALSE FALSE TRUE