This function outputs the indices of one triangle (the lower one by default) of an input square matrix. It is used by
simMat and, for large matrices, makes it faster than e.g. with
triMatInd(mat, lower = TRUE, list = FALSE)
a square matrix.
logical indicating whether the indices should correspond to the lower triangle. The default is TRUE; FALSE produces the upper triangle indices.
logical indicating whether the results should be output as a list instead of a matrix. The default is FALSE.
The indices (row, column) of the elements of the matrix that belong to the requested triangle.
A. Marcia Barbosa
mat <- matrix(nrow = 4, ncol = 4) mat triMatInd(mat) triMatInd(mat, list = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.