LaTeX table exporter
Export a data frame to a fancy LaTeX table environment.
tbl2tex(tbl, label = "tbl:label(must_be_changed!)", caption = "Table generated with tbl2tex.", centered = TRUE, alignment = "center", digits = getOption("digits"), hline = TRUE, vline = TRUE, file = "", topleftcell = " ")
tbl
: object of type data frame or matrixlabel
: label for LaTeX cross referencecaption
: caption for LaTeX tabular environmentcentered
: logical. TRUE
for centered cellsalignment
: alignment of the object on the pagedigits
: decimal digits after decimal pointhline
: logical. TRUE
for horizontal bordersvline
: logical. TRUE
for vertical bordersfile
: filename for outputting. If none is provided, LaTeX code is routed through the consoletopleftcell
: text for the top-left cell of the tableThis is a utility function intended to ease convertion of R objects to LaTeX format. It only exports data frame or data matrix nonetheless.
LaTeX code is routed through file or console for copying and pasting.
Washington Leite Junger wjunger@ims.uerj.br
For now, it handles only numerical data.
pgam
library(pgam) data(aihrio) m <- aihrio[1:10,4:10] tbl2tex(m,label="tbl:r_example",caption="R example of tbl2tex",digits=4)
Useful links