This function prints a (possibly abbreviated) matrix
.
Usage
print_matrix(
x,
rowdots = 4,
coldots = 4,
digits = 2,
label = NULL,
simplify = FALSE,
details = !simplify
)
Arguments
- x
[
atomic()
|matrix
]
The object to be printed.- rowdots
[
integer(1)
]
The row number which is replaced by...
.- coldots
[
integer(1)
]
The column number which is replaced by...
.- digits
[
integer(1)
]
The number of printed decimal places if inputx
isnumeric
.- label
[
character(1)
]
A label forx
. Only printed ifsimplify = FALSE
.- simplify
[
logical(1)
]
Simplify the output?- details
[
logical(1)
]
Print the type and dimension ofx
?
See also
Other package helpers:
Dictionary
,
Storage
,
identical_structure()
,
input_check_response()
,
match_arg()
,
package_logo()
,
print_data.frame()
,
system_information()
,
unexpected_error()
,
user_confirm()
Examples
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,] -0.82
#> [2,] -0.63
#> [3,] 1.71
#> ... ...
#> [99,] -0.45
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 ]