The print_matrix()
function prints a (possibly
abbreviated) matrix
:
print_matrix(x = 1, label = "single numeric")
#> single numeric : 1
print_matrix(x = LETTERS[1:26], label = "letters")
#> letters : character vector of length 26
#> A B C ... Z
print_matrix(x = 1:3, coldots = 2)
#> double vector of length 3
#> 1 ... 3
print_matrix(x = matrix(rnorm(99), ncol = 1), label = "single column matrix")
#> single column matrix : 99 x 1 matrix of doubles
#> [,1]
#> [1,] -2.07
#> [2,] -0.25
#> [3,] 0.31
#> ... ...
#> [99,] 1.39
print_matrix(x = matrix(1:100, nrow = 1), label = "single row matrix")
#> single row matrix : 1 x 100 matrix of doubles
#> [,1] [,2] [,3] ... [,100]
#> [1,] 1 2 3 ... 100
print_matrix(x = matrix(LETTERS[1:24], ncol = 6), label = "big matrix")
#> big matrix : 4 x 6 matrix of characters
#> [,1] [,2] [,3] ... [,6]
#> [1,] A E I ... U
#> [2,] B F J ... V
#> [3,] C G K ... W
#> [4,] D H L ... X
print_matrix(x = diag(5), coldots = 2, rowdots = 2, simplify = TRUE)
#> [ 1 ... 0; ... ... ...; 0 ... 1 ]
The matrix_indices()
function returns matrix indices as
character
: