Format a matrix and add index column.
formatMatrix(
x,
rnames = rownames(x),
pre.index = c(T, F),
cnames = seq_len(ncol(x)),
indexcol = F,
digits = 2,
diag = F,
mode = 1
)
A matrix object.
Row names.
Whether to make index prefix for rows and column names.
Column names.
Whether to make an index column.
Whether to show diagonal.
Whether to show upper (mode=1), lower (mode=2) or both triangles (mode=0) of the matrix.