xm | R Documentation |
Convert a matrix to LaTeX code.
xm(x, digits = NA, mtype = NA, round = NA, na = NA)
xmt(x, digits = NA, mtype = NA, round = NA, na = NA)
x |
A matrix object. |
digits |
Number of digits to display (if matrix is numeric). |
mtype |
LaTeX matrix type, i.e. round braces, curly braces etc.
Available types are |
round |
Logical. Round numbers? If not numbers are trimmed only. |
na |
How to replace NA values? (default is |
Object of class texcode
.
Mark Heckmann
m <- matrix(1:9, ncol=3)
xm(m)
# change digits
"$" %% xm(m) %% "$"
"$" + xm(m) + "$"
# matrix types
x <- matrix(1:4, 2)
xm(x, mtype="matrix")
xm(x, mtype="bmatrix")
rownames(x) <- letters[1:2]
colnames(x) <- LETTERS[1:2]
xm(x, mtype="bordermatrix")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.