Given a numeric matrix, a data.frame, a tibble or a data.table returns a basic LaTeX table write with table and tabular packages. Rownames and colnames are highlighted with bold.
Examples
mat <- matrix(1:9, nrow = 3)
mat
#> [,1] [,2] [,3]
#> [1,] 1 4 7
#> [2,] 2 5 8
#> [3,] 3 6 9
tableToLatex(mat)
#> \begin{table}[htbp]
#> \centering
#> \begin{tabular}{ccc}
#> \textbf{ V1 } & \textbf{ V2 } & \textbf{ V3 } \\
#> 1.000 & 4.000 & 7.000 \\
#> 2.000 & 5.000 & 8.000 \\
#> 3.000 & 6.000 & 9.000 \\
#> \end{tabular}
#> \caption{}
#> \label{}
#> \end{table}