Helper function to produce output for square matrices, e.g. distance matrices etc. Adds a (trimmed) name and index column. Displays upper triangle only by default. The function is used inside the print method of several classes.
print_square_matrix(
x,
names = NA,
trim = NA,
index = TRUE,
width = NA,
upper = TRUE
)
A square matrix
.
names A vector of row names.
Trimmed length of names (numeric).
Whether to add an index columns (default TRUE
).
Column width of output (numeric).
Whether to only show the upper triangle (default TRUE
).