Print a matrix for LaTeX.
Arguments
- mat
A matrix.
- type
[character(1): "pmatrix"]
: Matrix environment to use, e.g.bmatrix
for[]
-enclosed (brackets) orpmatrix
for()
(parentheses).- round
[integer(1): 3]
Examples
mat <- matrix(1:9, ncol = 3)
mattex(mat)
#> \[\begin{pmatrix}
#> 1 & 4 & 7 \\
#> 2 & 5 & 8 \\
#> 3 & 6 & 9
#> \end{pmatrix}\]