FormatTableAsLatex.Rd
Latex representation of a data.table with matrix and vectors in its cells
FormatTableAsLatex(x, argsXtable = list(), ...)
x | a data.table |
---|---|
argsXtable | a list (empty list by default) passed to xtable... |
... | additional arguments passed to print.xtable. |
a character string representing a parseable latex text.
dt <- data.table::data.table( A = list( matrix(c(2, 0, 1.2, 3), 2, 2), matrix(c(2.1, 0, 1.2, 3.2, 1.3, 3.4), 3, 2)), b = c(2.2, 3.1)) print(FormatTableAsLatex(dt))#> [1] "\\begin{table}[ht]\n\\centering\n\\begin{tabular}{rr}\n \\hline\n$A$ & $b$ \\\\ \n \\hline\n $\\begin{bmatrix}{} 2.0000000 & 1.2000000 \\\\ 0.0000000 & 3.0000000 \\\\ \\end{bmatrix}$ & $\\begin{bmatrix}{} 2.2000000 \\\\ \\end{bmatrix}$ \\\\ \n \\vspace{2mm} \n $\\begin{bmatrix}{} 2.1000000 & 3.2000000 \\\\ 0.0000000 & 1.3000000 \\\\ 1.2000000 & 3.4000000 \\\\ \\end{bmatrix}$ & $\\begin{bmatrix}{} 3.1000000 \\\\ \\end{bmatrix}$ \\\\ \n \\hline\n\\end{tabular}\n\\end{table}"